CDDSO-648: Unify cell_methods when reading ocean data by removing "interval" specifications#453
Merged
Matthew Mizielinski (matthew-mizielinski) merged 3 commits intoApr 25, 2025
Conversation
Collaborator
mo-kerstinschmatzer
left a comment
There was a problem hiding this comment.
LGTM
But tests are failing because of code style issues.
Collaborator
Author
Thanks -- I've fixed these tests and amended the docstring for the new function. |
Jared Drayton (mo-jareddrayton)
requested changes
Apr 25, 2025
Collaborator
There was a problem hiding this comment.
A few docstring/naming things (still looking at code changes).
- The docstring return section can go as cubes are modified in place
- The docstring
cubesargument should be airis.cube.CubeListrather thaniris.cube.Cube. - The function says
remove_cell...but as far as I can tell it is unifying the interval cell methods rather than removing them. Might be better to rename the function. EDIT: I see that they are removed. - The docstring format like a mix of both NumPy and Google style. (not that it matters that much as there are already at least three distinct docstring styles used throughout
mip_convert...)
Collaborator
Author
Thanks for catching this Jared, I think I started the docstring when I had accidentally put the code within one of the iris modules (don't ask) and failed to correct it when I moved the function to its current home. Docstring simplified and updated format in 51c74cb |
Jared Drayton (mo-jareddrayton)
approved these changes
Apr 25, 2025
0f0bcd4
into
v3.1_release
1 check passed
Matthew Mizielinski (matthew-mizielinski)
added a commit
that referenced
this pull request
Apr 25, 2025
Collaborator
Author
|
cherry picked to main in 42c182f |
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.
Some UKESM models have experienced problems due to changes in ocean timestep being made mid year as this propagates into the cell_methods attribute attached to data variables in the model input files.
This change adds an extra step before cubes are concatenated together within MIP Convert where the cell_methods are checked and, if necessary, unified by removing the "intervals" component of the CellMethod.
Note: this change should not affect PP atmosphere data as the timestep is not encoded in the PP header.