pull_requests: 1626561545
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1626561545 | PR_kwDOAMm_X85g81wJ | 8510 | closed | 0 | Grouper object design doc | 2448579 | xref #8509, #6610 **Rendered version** [here](https://github.com/dcherian/xarray/blob/grouper-proposal/design_notes/grouper_objects.md) ----- @pydata/xarray I've been poking at this on and off for a year now and finally figured out how to do it cleanly (#8509). I wrote up a design doc for `Grouper` objects that allow custom conversion of DataArrays to integer group codes, following the NEP template (which is absolutely great!). Such Grouper objects allow us to generalize the GroupBy interface to a much larger class of problems, and eventually provide a nice path to grouping by multiple variables (#6610) #8509 implements two custom Groupers for you to try out :) ```python import xarray as xr from xarray.core.groupers import SeasonGrouper, SeasonResampler ds = xr.tutorial.open_dataset("air_temperature") # custom seasons! ds.air.groupby(time=SeasonGrouper(["JF", "MAM", "JJAS", "OND"])).mean() ds.air.resample(time=SeasonResampler(["DJF", "MAM", "JJAS", "ON"])).count() ``` All comments are welcome, 1. there are a couple of specific API and design decisions to be made. I'll make some comments pointing these out. 2. I'm also curious about what `Grouper` objects we should provide in Xarray. ----- cc @ilan-gold @ivirshup @aulemahal @tomvothecoder @jbusecke @katiedagon - it would be good to hear what "Groupers" would be useful for your work / projects. I bet you already have examples that fit this proposal | 2023-12-02T04:56:54Z | 2024-03-06T02:27:07Z | 2024-03-06T02:27:04Z | 2024-03-06T02:27:04Z | cb09522aeb0c7b4d52d43b4bfec2093bbf56f6e0 | 0 | b3944512c250504a6f1b3c6ea6be88238e119d54 | 5213f0d63465eac228822fb7299046e0c6701acc | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/8510 |
Links from other tables
- 2 rows from pull_requests_id in labels_pull_requests