Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor code #30

Closed
14 tasks done
veenstrajelmer opened this issue May 20, 2024 · 0 comments · Fixed by #33
Closed
14 tasks done

refactor code #30

veenstrajelmer opened this issue May 20, 2024 · 0 comments · Fixed by #33

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented May 20, 2024

Limit public functions and simplify example scripts:

  • 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")
  • put default filenames in dict so their strings are not duplicated
  • 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
  • move all analysis functions to data_analysis.py and call these functions from separate example script. Also include duplicate ext finding function from Incorrect extreme values for BERGSDSWT and others Rijkswaterstaat/wm-ws-dl#43. Execute per station and call in station-loop in example script.
  • 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
  • prevent exposure of private stats functions, they might be exposed via __all__ now
  • solve TODO kw.data_analysis.plot_measurements() script about timezones >> maybe Add timezone to ddlpy.dataframe_to_xarray() Deltares/ddlpy#105 >> by always converting ds to df
  • maybe convert netcdf back to ddlpy-like dataframe in kw.read_measurements(), but how to handle extreme types?
  • convert kw.derive_statistics() from ds to df
  • move tidal indicators to separate module, now in slotgemiddelden.py
  • fix "TypeError: Cannot compare tz-naive and tz-aware timestamps" when running kwk_process.py
  • check number of stations in locations df only once in data_retrieval.py, so move this check to a function
  • 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
  • add plot_stations function #56

Follow up issue: #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant