Commit 46e43ab5 authored by alaskamapscience's avatar alaskamapscience
Browse files

Fix timeseries rounding bug

parent b5dff7a7
......@@ -67,10 +67,10 @@ class TimeSeries(basechart.BaseChart):
df = bmsapp.data_util.decimate_timeseries(df, bin_count=1000,col='val')
# create lists for plotly
if np.absolute(df.val.values).max() < 10000:
values = df.val.round(4).where(df.val.notnull(),None).values.tolist()
if df.val.abs().max() < 10000:
values = [round(x,4) if not np.isnan(x) else None for x in df.val]
else:
values = df.val.round(0).where(df.val.notnull(),None).values.tolist()
values = [round(x) if not np.isnan(x) else None for x in df.val]
times = df.index.strftime('%Y-%m-%d %H:%M:%S').tolist()
else:
times = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment