-
Notifications
You must be signed in to change notification settings - Fork 61
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
[sdba] Optimizations and fixes #791
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
…into sdba-opt-and-fixes-sg2
7 tasks
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
huard
approved these changes
Aug 26, 2021
Co-authored-by: David Huard <huard.david@ouranos.ca>
This was referenced Aug 27, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
sdba
? #810bumpversion (major / minor / patch)
has been called on this branchgit push --tags
).zenodo.json
What kind of change does this PR introduce?
map_blocks
when using coords backed bycftime.datetime
objects. Dask needs some sort of hash for each input and that tokenization is quite slow for cftime np.ndarrays because it goes throughpickle.dumps
(see Performance : speeding up pickling of cftime arrays Unidata/cftime#253). Also,CFTimeIndex
are slow to create because of a check that cycles through all elements of the array. With many chunks and large time dimensions, this takes a significant portion of the call time (excluding the actual computation). Here we add an option to encode cftime coordinate into integers (+ attributes), like in a netCDF, saving time on the cftime handling. The decoding is done within the task itself (thus in parallel).adapt_freq
to skip computation on all-nan blocks.nbu.vecquantile
whenrnk
is NaN.map_blocks
to set the template variables to the largest dtype of the inputs.map_blocks
andmap_groups
to consider dimensions inGrouper.add_dims
. By default, functions wrapped withmap_groups
will assume Grouper.DIM AND Grouper.ADD_DIMS are all reduced, unlessmain_only=True
is passed.qm_adjust
is now using values just over and under the max and min of the target data, instead of±np.inf
. There was a bug I had while adjusting precipitation in ESPO-R that was solved by this. I'm not completly sure why...Does this PR introduce a breaking change?
I think not, but this PR was so iterative over a long time, I'm not 100% sure.
Other information:
All those optimizations and fixes were done while processing "scénarios génériques v2". Except the
add_dims
thing.