Deltares/ddlpy

Improvements for measurements dataframe

Closed this issue · 0 comments

  • ddlpy version: master
  • Python version: 3.11
  • Operating System: Windows

Description

Some suggestions for improvements for the dataframe returned by ddlpy.measurements():

  • replace ".code" with ".Code" in column names, for consistency. To avoid doing this downstream: measurements.columns = [x.replace(".code",".Code") for x in measurements.columns] >> https://github.com/openearth/ddlpy/blob/dd57a45d8a20e8146bcd76c05b8115c72d3aceca/ddlpy/ddlpy.py#L156
  • replace locatie_code with Code
  • rename "t" to "time", so this is recognized by xarray as the time variable/dimension
  • set "time" as index, makes plotting easier and probably easier for xarray
  • if nodata, return None instead of []?
  • nodata print al logging
  • also keep "Code" as column in locations dataframe (is now dropped when setting as index), would simplify code here and there. However, single source of truth is also worth something. (in that case consider dropping "Tijdstip" column since it is a duplicate of "t" >> won't do
  • consider QC as int, but avoid TypeError "int() argument must be a string, a bytes-like object or a real number, not 'NoneType'" >> won't do
  • update testcases, example script and jupyter notebook