-
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-494: Phase probability plugin without percentile generation #1903
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1903 +/- ##
==========================================
- Coverage 98.33% 98.32% -0.01%
==========================================
Files 120 120
Lines 11383 11376 -7
==========================================
- Hits 11193 11186 -7
Misses 190 190
|
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 Ben. Generally it looks good and all the test passed. There's just a couple of typos and a query about one of the ValueError's you're raising.
improver/psychrometric_calculations/precip_phase_probability.py
Outdated
Show resolved
Hide resolved
improver/psychrometric_calculations/precip_phase_probability.py
Outdated
Show resolved
Hide resolved
improver/psychrometric_calculations/precip_phase_probability.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.
One small update of adding the error message to the docstring as I mentioned above along with some conflicts to resolve.
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 think this change does what we need.
As well as the two suggestions, I cannot see any tests with non-equal-area gridded data, which these changes are targetting. Could a test be added somewhere? I can't see any reason why it should fail, but...
improver/psychrometric_calculations/precip_phase_probability.py
Outdated
Show resolved
Hide resolved
...ver_tests/psychrometric_calculations/precip_phase_probability/test_PrecipPhaseProbability.py
Show resolved
Hide resolved
@MoseleyS I've added some acceptance tests to demonstrate that the code works with lat-lon grids. |
… a rain or snow phase is chosen if somehow the falling level of the two is identical; this would otherwise end up as sleet, which is not awful either, but here we hedge by the slightest amount towards snow.
…oppv#1903) * Starting to rewrite tests. * Unit tests updated. * Tweaks to unit tests and new acceptance tests. * Further tests added. Comparator for snow changed to ge to ensure that a rain or snow phase is chosen if somehow the falling level of the two is identical; this would otherwise end up as sleet, which is not awful either, but here we hedge by the slightest amount towards snow. * Checksum update and style fixes. * Add extra test. * Add value error to doc-string. * Review changes.
Follows #1902
The phase-probability CLI and plugin have been modified to remove the internal neighbourhooding. Instead the plugin now relies upon input data being provided with percentile data if that is desired, where these percentiles may have been constructed from a neighbourhood. This will allow us to use this plugin with spot data, where the percentiles have been generated on the grid prior to spot extraction; we can't neighbourhood spot-data sensibly.
The changes also allow us to extract probabilities without the use of neighbourhoods (and no resulting percentile coordinate), such that we can use non-equal-area grid data without having to apply neighbourhoods. This allows us to continue using the phase-probability plugin with global data (as was recently implemented: #1902).
Testing: