-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Use cumsum from flox #10987
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
base: main
Are you sure you want to change the base?
Use cumsum from flox #10987
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Co-authored-by: Deepak Cherian <[email protected]>
for more information, see https://pre-commit.ci
| **kwargs, | ||
| ) | ||
|
|
||
| # Prefer Dataset.func(...) over Dataset.reduce(func, ...): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed
cc @TomNicholas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of #6528 and #10987 (comment). Since the problem of Datasets dropping the coords is solved in .cumsum in this PR, DataTree must also use ds.cumsum instead of ds.reduce("cumsum") in order to avoid dropping the coordinates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's update the code comment to reflect your comment above
|
@dcherian, this is ready for a another review now. It was only changes in tests since the last time. |
|
Are you able to address the extra testing requested in #10987 (comment)? If you're too busy, we can just merge. This is a good improvement. |
whats-new.rstThe non-flox version reduces chunksizes significantly:
With flox the chunksize is retained:
Other changes:
Notes
groupby_scanwas added in: https://github.com/xarray-contrib/flox/releases/tag/v0.9.9cumsumwas added in: https://github.com/xarray-contrib/flox/releases/tag/v0.10.5