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 · May be fixed by #380
Open

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

dcherian opened this issue Apr 25, 2024 · 1 comment · May be fixed by #380

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.

dcherian added a commit that referenced this issue Aug 2, 2024
Done when
1. `method` is None
2. Grouping and reducing by a 1D array

We gate this on fractional change in number of chunks and change in size
of largest chunk.

Closes #359
@dcherian dcherian linked a pull request Aug 2, 2024 that will close this issue
2 tasks
dcherian added a commit that referenced this issue Aug 2, 2024
Done when
1. `method` is None
2. Grouping and reducing by a 1D array

We gate this on fractional change in number of chunks and change in size
of largest chunk.

Closes #359
dcherian added a commit that referenced this issue Aug 2, 2024
Done when
1. `method` is None
2. Grouping and reducing by a 1D array

We gate this on fractional change in number of chunks and change in size
of largest chunk.

Closes #359
dcherian added a commit that referenced this issue Aug 2, 2024
Done when
1. `method` is None
2. Grouping and reducing by a 1D array

We gate this on fractional change in number of chunks and change in size
of largest chunk.

Closes #359
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 a pull request may close this issue.

1 participant