-
Notifications
You must be signed in to change notification settings - Fork 89
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
MOBT-661: Required changes for precipitation phase accumulations #1997
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1997 +/- ##
==========================================
- Coverage 98.39% 98.39% -0.01%
==========================================
Files 124 133 +9
Lines 12212 13060 +848
==========================================
+ Hits 12016 12850 +834
- Misses 196 210 +14 ☔ View full report in Codecov by Sentry. |
In order to maintain a backlog of relevant PRs, we automatically label them as stale after 60 days of inactivity. If this PR is still important to you, then please comment on this PR and the stale label will be removed. Otherwise this PR will be automatically closed in 30 days time. |
Commenting to remove 'staleness'. |
873974b
to
46ccc84
Compare
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.
Thanks @brhooper 👍
I've added some comments and suggestions.
improver_tests/utilities/cube_manipulation/test_manipulate_realization_dimension.py
Outdated
Show resolved
Hide resolved
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.
Thanks @brhooper 👍
I've happy to approve these changes, subject to the GitHub Actions failures being addressed.
…ities. Add unit tests.
…ts of new functionality.
…Add acceptance test and data for this functionality. Update checksums. Change numpy broadcasting method in plugin.
…ding acceptance tests. Update checksums.
…dimension coordinate var_name attributes does not cause an error, except where the var_name is different on a threshold coordinate. Change made to better work with the functionality of MergeCubes, which removes var_name from non-threshold dimension coordinates.
… the input cube. Update checksums for new data for this test.
b37cf83
to
f7aff40
Compare
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.
Incredibly minor questions / comments.
|
||
output = manipulate_n_realizations(cube, n_realizations) | ||
|
||
return output |
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.
I haven't really got a map in my head of the way you'll implement this in the suite, but I'm a little surprised this method got a CLI. Are you intending to call it as a preliminary step in the suite chain, rather than it being something that is used internally within ECC?
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.
Okay, you do call this without the CLI. Is this just for completeness, an envisaged future use, or just to allow for acceptance tests?
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.
Good question. I think I added the CLI out of habit to be honest.
I can't think of a use case for the manipulate-n-realizations
CLI at the moment and the acceptance tests don't test anything which isn't covered by the unit tests. As such, I've removed the CLI and associated acceptance tests.
@@ -222,8 +223,10 @@ def _check_dimensions_match( | |||
Raises: | |||
ValueError: If dimension coordinates do not match | |||
""" | |||
ref_coords = cube_list[0].coords(dim_coords=True) | |||
for cube in cube_list[1:]: | |||
test_cube_list = iris.cube.CubeList(cube_list.copy()) |
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.
The doc-string probably now needs to specify that this check excludes the var_names of the coordinates.
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.
Doc-string updated
calibrated_cube = self.cube_2d.copy(data=calibrated_data) | ||
|
||
result = Plugin().rank_ecc(calibrated_cube, raw_cube, random_seed=1) | ||
self.assertArrayAlmostEqual(result.data, result_data) |
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.
Any particular reason this test was modified? Is it simply to differentiate it to the test below?
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.
Yes, I modified the test so that result_data
was different for the 2 tests. My aim was to demonstrate the difference between using random and realisation tie-breaking.
…ceptance tests. Add additional information to _check_dimensions_match doc-string.
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.
Thanks for all of this Ben.
Related to: https://github.com/metoppv/mo-blue-team/issues/661, https://github.com/metoppv/mo-blue-team/issues/671
Acceptance test data: metoppv/improver_test_data#48
Description
This PR includes a few changes which are required for the work to produce precipitation phase accumulations over longer periods.
Included changes are as follows:
combine
plugin easier to pass - test will no longer fail if coordinates on input cubes differ in thevar_name
, except if the difference is on a threshold coordinate. This mirrors, and was necessitated by, the functionality of theMergeCubes
plugin, which removes this attribute from coordinates.Testing: