-
Notifications
You must be signed in to change notification settings - Fork 44
Unify handling of group coordinates in temporal statistics preprocessors #2787
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?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2787 +/- ##
==========================================
+ Coverage 95.59% 95.62% +0.02%
==========================================
Files 266 266
Lines 15573 15581 +8
==========================================
+ Hits 14887 14899 +12
+ Misses 686 682 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
To properly unify this, it would be nice to use the same default value for
@ESMValGroup/technical-lead-development-team opinions? |
Not sure where we stand on this. Maybe it would require some further discussions at the next @ESMValGroup/technical-lead-development-team meeting before considering merging? |
Could you do a |
Long story short, following Manuel's initial comment, switching by default to use (Hopefully did not miss anything while copying)
|
|
Thank you for the summary, and I apologize that my question was not clear. What I meant was that I agree that setting CMORizers should always discard the group coordinates, as these are not part of the variable definition in the CMOR tables. |
Aaaah I understand now! The number of recipes is greatly reduced it seems (hopefully I haven't missed any).
|
|
In that case, it looks like only four recipes would be affected and we could change the default to |
| ) -> Cube: | ||
| """Apply standardization or relative scaling.""" | ||
| if standardize: | ||
| cube_div = climate_statistics( |
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.
Changed this here because cube_div was potentially undefined
|
Set |
Description
This PR adds the keyword argument
keep_group_coordinates(by defaultkeep_group_coordinates=False) to temporal statistics preprocessors which controls how group coordinates (likeyear,day_of_year) are handled. Previously, each preprocessor handled this differently. Affected preprocessors:hourly_statistics(previous default:keep_group_coordinates=False)daily_statistics(previous default:keep_group_coordinates=False)monthly_statistics(previous default:keep_group_coordinates=True)seasonal_statistics(previous default:keep_group_coordinates=True)annual_statistics(previous default:keep_group_coordinates=True)decadal_statistics(previous default:keep_group_coordinates=True)Backwards-incompatible change #
This PR changes the default behavior of the preprocessor functions
monthly_statistics(group coordinatesmonth_numberandyear)seasonal_statistics(group coordinatesclim_seasonandseason_year)annual_statistics(group coordinateyear)decadal_statistics(group coordinatedecade)Previously, the returned cubes of these preprocessor functions contained the corresponding group coordinates. After this PR, those coordinates are not present in the returned cubes anymore.
To restore the old behavior, set
keep_group_coordinatestoTrue, e.g. in the recipeor Python script
See ESMValGroup/ESMValTool#4129.
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: