-
Notifications
You must be signed in to change notification settings - Fork 59
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
Block-mapped resample with the help of flox #1848
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aulemahal
changed the title
Resample map
Block-mapped resample-map with the help of flox
Jul 19, 2024
Zeitsperre
reviewed
Jul 26, 2024
for more information, see https://pre-commit.ci
This reverts commit a7e5bde.
This reverts commit 9778739.
aulemahal
changed the title
Block-mapped resample-map with the help of flox
Block-mapped resample with the help of flox
Sep 6, 2024
for more information, see https://pre-commit.ci
Zeitsperre
reviewed
Sep 6, 2024
8 tasks
coxipi
reviewed
Oct 2, 2024
coxipi
reviewed
Oct 2, 2024
coxipi
reviewed
Oct 2, 2024
coxipi
reviewed
Oct 9, 2024
coxipi
reviewed
Oct 9, 2024
coxipi
approved these changes
Oct 9, 2024
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.
approved!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist:
number
) and pull request (:pull:number
) has been addedWhat kind of change does this PR introduce?
Implements
resample_map
. This function is meant for allda.resample(...).map(...)
calls. These,flox
cannot improve automatically so we use some flox logic to help. The idea is to map the resample-map construct on each block in parallel. This is possible by first rechunking the array so that chunks boundary fit with resampling period boundaries (this is a flox function).The main improvement should come from the fact that
map_blocks
hides much of the complexity todask
, so the resulting graph is much lighter. I still have to better test the performance of this. My goal would be to have some short text in xclim's doc that highlights when the option is useful and when it is not. The option is activated throughset_options
.The current function works only when the input object is of the same type as the output one. So some functions couldn't be wrapped with this yet. The most important untouched code for the moment is the missing checks where I think this could help a lot.
Does this PR introduce a breaking change?
It should not. This is completely optional.
Other information:
In progress, I still need to prove the performance boost.
This depends on #1845 because I need all improvements for PC.