xcdat icon indicating copy to clipboard operation
xcdat copied to clipboard

[Enhancement]: Refactor `custom_seasons` to use Xarray's `SeasonGrouper()` API [WIP]

Open tomvothecoder opened this issue 1 year ago • 0 comments

Is your feature request related to a problem?

The current custom_seasons back-end uses Pandas DataFrames to store Datetime components, which then get manipulated downstream (e.g., shifting months for spanning calendar years, dropping incomplete seasons).

Describe the solution you'd like

In Xarray PR #9524, the SeasonGrouper() API will introduce:

  • groupby() custom seasons
  • support seasons that span the calendar year (uses previous year for correct grouping)
  • drop_incomplete to drop incomplete seasons

Describe alternatives you've considered

No response

Additional context

No response

tomvothecoder avatar Nov 14 '24 19:11 tomvothecoder