Limit public functions and simplify example scripts:
[x] move data retrieve to functions in data_retrieve.py and return ds (download of netcdf file is not present, open if it is present). Something like kw.data.timeseries("HOEKVHLD") and kw.data.extremes("HOEKVHLD")
[x] put default filenames in dict so their strings are not duplicated
[x] Many data_retrieve functions have station_list instead of station argument, do for all functions or not? >> no retrieve/read meas is per station, rest is for entire station_list
[x] move all analysis functions to data_analysis.py and call these functions from separate example script. Also include duplicate ext finding function from https://github.com/Rijkswaterstaat/wm-ws-dl/issues/43. Execute per station and call in station-loop in example script.
[x] solve 5 remaining TODO in kw.data_analysis.plot_measurements() script. They are related to aggers and monthly/yearly averages for ts and ext. Maybe first make hwlwconvert modular so we can also apply it to an xarray.Dataset
[x] prevent exposure of private stats functions, they might be exposed via __all__ now
[x] maybe convert netcdf back to ddlpy-like dataframe in kw.read_measurements(), but how to handle extreme types?
[x] convert kw.derive_statistics() from ds to df
[x] move tidal indicators to separate module, now in slotgemiddelden.py
[x] fix "TypeError: Cannot compare tz-naive and tz-aware timestamps" when running kwk_process.py
[x] check number of stations in locations df only once in data_retrieval.py, so move this check to a function
[x] kw.read_measurements() now returns None if no meas netcdf available, better alternative? Also returning none if no meas/loc available on ddlpy? Make this consistent or raise specific error that can be catched >> fine for now, maybe iterate later
Limit public functions and simplify example scripts:
kw.data.timeseries("HOEKVHLD")
andkw.data.extremes("HOEKVHLD")
kw.data_analysis.plot_measurements()
script. They are related to aggers and monthly/yearly averages for ts and ext. Maybe first make hwlwconvert modular so we can also apply it to anxarray.Dataset
__all__
nowkw.data_analysis.plot_measurements()
script about timezones >> maybe https://github.com/Deltares/ddlpy/issues/105 >> by always converting ds to dfkw.read_measurements()
, but how to handle extreme types?kw.derive_statistics()
from ds to df"TypeError: Cannot compare tz-naive and tz-aware timestamps"
when running kwk_process.pykw.read_measurements()
now returnsNone
if no meas netcdf available, better alternative? Also returning none if no meas/loc available on ddlpy? Make this consistent or raise specific error that can be catched >> fine for now, maybe iterate laterFollow up issue: https://github.com/Deltares-research/kenmerkendewaarden/issues/32