Skip to content

Conversation

@andrevdv
Copy link

Directly related to Issue #477 - xarray support

  • Added support for xarray.Dataset by converting to a pandas DataFrame internally.
  • Added error messages when:
    • only a single discharge series is passed
    • unsupported data formats are used.

Other changes:

Structure

  • Moved the hydrograph code out of __init__.py into its own file(hydrograph.py).
  • Split the large hydrograph() function into multiple helper functions to reduce complexity and improve maintainability.
  • these are all private now, might be worth expanding and making them public at a later stage.

plot:

  • Added a grid for improved readability.
  • Reference series is always plotted first and drawn on top.
  • Reference is visually distinguished when comparing multiple hydrographs.
  • Improved default title when no title is provided.

metrics:

  • Added metrics_list argument:
    • Allows selecting metrics from the hydrostats package.
    • Defaults to: ["nse", "kge_2009", "sa", "me"].
  • Metrics table now includes both abbreviation and full name.

other changes:

  • Added selected_year to slice both discharge and precipitation to a single year.
  • Added new tests:
    • xarray input
    • single-year slicing
    • multiple discharge series
    • single discharge series
    • error cases

known issues at the moment

  • When precipitation is included, the precipitation legend overwrites the discharge legend.
  • Long metric names cause the metrics table to automatically reduce font size

possible improvements

  • make helper functions public
  • Automatically adjust the plot/table height ratio (currently 75/25) based on the number of hydrographs being plotted, improving readability for cases with many or few series.
hydrograph_DataFrame hydrograph_xarray hydrograph_xarray_single_comparison hydrograph_xarray_single_year

@andrevdv
Copy link
Author

done for the day, do i need to do something with these?

Run codecov/codecov-action@v4
Error: Codecov: Failed to get OIDC token with url: https://codecov.io./ Error message: Unable to get
ACTIONS_ID_TOKEN_REQUEST_URL env variable

if yes, i will work on it tomorrow.

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 this pull request may close these issues.

1 participant