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

Consider preferred_method="blockwise" if by is sorted #359

Open
dcherian opened this issue Apr 25, 2024 · 1 comment
Open

Consider preferred_method="blockwise" if by is sorted #359

dcherian opened this issue Apr 25, 2024 · 1 comment

Comments

@dcherian
Copy link
Collaborator

dcherian commented Apr 25, 2024

I'm thinking of groupby("time.year"), which looks like a resample, and also resampling type aggregations,

In general, if by is sorted, then blockwise is potentially the best option.

We could gate this on

  1. 1D by
  2. ???

I still prefer the idea of using preferred_chunks on xarray's new Grouper objects to rechunk it intentionally but a heuristic might be effective in the intermediate.

method="blockwise" automatically rechunks, so this would be step towards the above.

@dcherian
Copy link
Collaborator Author

dcherian commented Apr 26, 2024

With size-1 chunks, e.g.|0|0|0|1|1|1|1, I'm not sure there's any benefit. It would be a regression for when num_blocks_per_groups > split_every

Note that using blockwise is still correct since we rechunk so that all group members are in a single block.

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

No branches or pull requests

1 participant