-
Notifications
You must be signed in to change notification settings - Fork 38
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
Make sure climate statistics always returns original dtype #1237
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1237 +/- ##
=======================================
Coverage 85.54% 85.54%
=======================================
Files 188 188
Lines 9150 9154 +4
=======================================
+ Hits 7827 7831 +4
Misses 1323 1323
Continue to review full report at Codecov.
|
else: | ||
clim_cube = iris.cube.CubeList( | ||
clim_cube.slices_over(clim_coord.name())).merge_cube() | ||
cube.remove_coord(clim_coord) |
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.
This line looks a bit fishy to me, but it was there before, so there is that. It looks like this should be clim_cube.remove_coord(clim_coord)
. @valeriupredoi, this seems to come from you. Do you have an opinion?
I am changing the tests in the time module to always check for the types |
I have detected the same problem when computing standardized anomalies, as they get converted to |
Be advised that I came to this solution via the anomalies. Turns out the problem with anomalies was that the climate_statistics, which are used in the calculation of the anomalies did this conversion, so maybe once this PR is in, the anomalies problem vanishes. |
I am working directly on this PR, so that's not the issue |
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.
Nice catch! I currently do not have access to data (BSC annual maintenace) to properly test with a recipe, though.
* Make sure climate statistics always returns original dtype * Homogenize different period branches * Change climate_statistics tests to consistently use float32 * Change logging style to old logging style
Description
This adds code to the climate_statistics preprocessor to detect whether it has changed the dtype of the cube. If this is the case, it changes the dtype back to the original dtype.
Closes #1235
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: