-
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
apply_bias_correction
fix: add handling for missing forecast cube
#1995
apply_bias_correction
fix: add handling for missing forecast cube
#1995
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1995 +/- ##
==========================================
+ Coverage 98.39% 98.41% +0.01%
==========================================
Files 124 124
Lines 12212 12337 +125
==========================================
+ Hits 12016 12141 +125
Misses 196 196 ☔ View full report in Codecov by Sentry. |
apply_bias_correction
fix: add handling for missing forecast cubeapply_bias_correction
fix: add handling for missing forecast cube
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 looks fine, a couple of small suggestions for your consideration
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 @benowen-bom 👍
I think that this essentially looks fine. I've suggested some minor typo corrections.
Thanks Gavin for the review and picking up those typos. All fixed. |
…etoppv#1995) * Update the cli signature for bias-correction cli and add tests for missing files. * Add function to separate forecast and forecast-error (bias) cubes * Tidy up split_forecasts_and_bias_files function and update acceptance tests. * Add unit tests for split_forecasts_and_bias_files function. * Update the apply_bias_correction CLI to raise warning when no calibration is applied. * Add unit test to check comment on output when no bias cubes supplied. * Fix typos picked up in review.
Addresses #1994
This PR the function
split_forecasts_and_bias_files
to separate out the forecast cube from the forecast_error (bias) cubes based oncube.name()
. Raises a Value Error when the forecast cube is not present, or when multiple forecast cubes have been passed in.The CLI now adds a warning when no bias_cubes are present and adds a comment to the attributes in the forecast (in line with how
apply_emos_coefficients
handles similar use case.Acceptance tests have been added to test this behaviour explicitly to ensure #1994 has been resolved. There is a new kgo that has been added for the case where no bias-cubes are added, included in the following PR: metoppv/improver_test_data#47.
Testing: