jlu-ilr-hydro / odmf

Observatory Data Management Framework
MIT License
4 stars 5 forks source link

Plotting transformed datasets does not work #79

Closed thouska closed 3 years ago

thouska commented 3 years ago

Tested with #1 groundwater head level and #13 discharge Both result in

Error

'DataFrame' object has no attribute 'time'

philippkraft commented 3 years ago

Problem was: handling of empty timeseries (in case of transformed timeseries, source dataset outside the query time).

thouska commented 3 years ago

Plotting of groundwater head level works fine now. Thx. However, transformed datasets of discharge still produce an error when plotted (e.g. ds370 and ds371 and site13 and 18):

cannot concatenate object of type '<class 'numpy.ndarray'>'; only Series and DataFrame objs are valid

Traceback (most recent call last): File "/srv/odmf/schwingbach/src/odmf/webpage/db_editor/datasetpage.py", line 436, in plot data = ds.asseries(start, end) File "/srv/odmf/schwingbach/src/odmf/db/dataset.py", line 518, in asseries data = data.append(v) File "/srv/odmf/schwingbach/venv/lib/python3.8/site-packages/pandas/core/series.py", line 2688, in append return concat( File "/srv/odmf/schwingbach/venv/lib/python3.8/site-packages/pandas/core/reshape/concat.py", line 274, in concat op = _Concatenator( File "/srv/odmf/schwingbach/venv/lib/python3.8/site-packages/pandas/core/reshape/concat.py", line 359, in init raise TypeError(msg) TypeError: cannot concatenate object of type '<class 'numpy.ndarray'>'; only Series and DataFrame objs are valid

philippkraft commented 3 years ago

where function returns an array instead of a Series. Fixed by transforming to series always.