Skip to content

Commit

Permalink
Merge pull request #123 from ricardogsilva/108-show-all-values-on-the…
Browse files Browse the repository at this point in the history
…-time-series-for-raw-data

Do not drop nan values for coverage times series
  • Loading branch information
francbartoli authored Jun 6, 2024
2 parents 19c2d52 + 1c05d06 commit d25665a
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 88 deletions.
1 change: 0 additions & 1 deletion arpav_ppcv/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ def _process_coverage_data(
)
df[column_name] = loess_smoothed
df = df.drop(columns=[base_column_name])
df = df.dropna()
return df


Expand Down
4 changes: 3 additions & 1 deletion arpav_ppcv/webapp/api_v2/routers/coverages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import math
import urllib.parse
import uuid
from typing import (
Expand Down Expand Up @@ -422,7 +423,8 @@ def _serialize_dataframe(
else:
measurements = []
for timestamp, value in series_measurements.items():
measurements.append(TimeSeriesItem(value=value, datetime=timestamp))
if not math.isnan(value):
measurements.append(TimeSeriesItem(value=value, datetime=timestamp))
series.append(
TimeSeries(
name=series_name,
Expand Down
68 changes: 20 additions & 48 deletions tests/notebooks/timeseries-related-demo.ipynb

Large diffs are not rendered by default.

92 changes: 79 additions & 13 deletions tests/notebooks/timeseries-smoothing-demo.ipynb

Large diffs are not rendered by default.

82 changes: 57 additions & 25 deletions tests/notebooks/timeseries-uncertainty-demo.ipynb

Large diffs are not rendered by default.

0 comments on commit d25665a

Please sign in to comment.