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

Group by #442

Merged
merged 5 commits into from
Apr 17, 2024
Merged

Group by #442

merged 5 commits into from
Apr 17, 2024

Conversation

tomwhite
Copy link
Member

Adds a groupby_reduction function for doing "grouped reductions". This is intended for flox to add Cubed support.

The only change needed to the regular reduction function is the addition of a combine_sizes parameter, which makes it possible to specify the size of an axis after the combine function has been applied. In normal reductions the reduction axes are always 1 (the combine_sizes default), but in a grouped reduction the axis representing the groups is instead the number of groups.

@tomwhite tomwhite added core xarray-integration Uses or required for cubed-xarray integration labels Apr 11, 2024
cubed/core/groupby.py Outdated Show resolved Hide resolved
@tomwhite tomwhite marked this pull request as ready for review April 16, 2024 11:00
@tomwhite tomwhite merged commit e2ea88b into main Apr 17, 2024
7 checks passed
@tomwhite tomwhite deleted the groupby branch April 17, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xarray-integration Uses or required for cubed-xarray integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants