Implemented fully lazy climate_statistics#1194
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1194 +/- ##
==========================================
- Coverage 85.51% 85.51% -0.01%
==========================================
Files 188 188
Lines 9147 9146 -1
==========================================
- Hits 7822 7821 -1
Misses 1325 1325
Continue to review full report at Codecov.
|
Contributor
Author
|
I think |
bouweandela
approved these changes
Jun 26, 2021
Member
There was a problem hiding this comment.
Looks good! I'll have a look at improving the codecov configuration so the checks are useful, see #1195
10 tasks
This file contains hidden or 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
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.
While working on #1193 I found that the preprocessor
climate_statisticsis not lazy ifperiod='full'and a weighted operator is used. The reason is the use ofiris.util.broadcast_to_shapehere, which broadcasts the time weights to the original shape of the cube.However, since the release of iris v3, this broadcasting is no longer necessary. PR SciTools/iris#3943 introduced the support of 1D weights for collapsing cubes. This PR implements this for our preprocessor.
Note that while our implementation might have worked previously for multidimensional time arrays, the calculation of the weights didn't make sense at all. Therefore, in this new implementation an error is raised if the time coordinate is not 1D. However, I don't even know if there is any use case for this.
I tested some recipes and all worked fine 👍 I also didn't modify the
climate_statisticstests at all, everything worked fine with the new implementation.Closes #336.
Link to documentation:
Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
To help with the number pull requests: