-
Notifications
You must be signed in to change notification settings - Fork 88
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
Refactor weather code plugins and CLIs #1944
Conversation
- CLI renamed from wxcode to categorical - WeatherSymbols plugin renamed to ApplyDecisionTree - Code moved from wxcode directory to categorical - Comments and variable names replaced with more agnostic definitions
- acceptance test data locations - extended docs locations
- Includes method for mapping day and night symbols - Includes extended documentation
… day-night and groupings info.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1944 +/- ##
==========================================
+ Coverage 98.38% 98.40% +0.01%
==========================================
Files 123 124 +1
Lines 11795 12028 +233
==========================================
+ Hits 11605 11836 +231
- Misses 190 192 +2
☔ View full report in Codecov by Sentry. |
- Each leaf has a unique value - "if_night" values do not point to leaves that have "if_night" values
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 Stephen. A few comments mostly around clarifying some docstrings but otherwise this looks good.
doc/source/extended_documentation/categorical/build_a_decision_tree.rst
Outdated
Show resolved
Hide resolved
I've updated the variable names in both files. This allows us to add other categorical data to the metadata interpreter in the future, if required. |
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 @MoseleyS 👍
I've added some very minor comments.
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 the updates, @MoseleyS 👍
I've added one trivial comment.
* Refactors wxcode to be more agnostic - CLI renamed from wxcode to categorical - WeatherSymbols plugin renamed to ApplyDecisionTree - Code moved from wxcode directory to categorical - Comments and variable names replaced with more agnostic definitions * Fixes failing tests following refactor * isort * More refactoring - acceptance test data locations - extended docs locations * Updates testing decision tree and check_tree method and tests * Updates categorical attribute generation and tests, and day_night functionality. * categorical utilities tests now all pass * Updates tests for create_categorical_cube * Updates ApplyDecisionTree and tests - Includes method for mapping day and night symbols - Includes extended documentation * Updates ModalWeatherCode which now needs the decision_tree to get the day-night and groupings info. * Renames ModalWeatherCode as ModalCategory and adds decision_tree to the CLI. * Updates checksums * Removes obsolete KeyError trap * Updates checksums * Tests bare category error in check tree * Adds test for day_night_map * Adds checks to make sure that leaf nodes meet these criteria - Each leaf has a unique value - "if_night" values do not point to leaves that have "if_night" values * isort * Adds test for case where a leaf is unreachable and isn't declared as such. * Adds "is_unreachable" to decision tree documentation * Updates following review. * Removes `wx` from variable names in categorical_attributes * Removes `wx` from variable names in metadata_interpreter.py * Simple review updates (non-functional) * Moves simple is_decision_node method into utilities and reuses it in another utility. Adds test. * Simplifies test to one line * Uses is_decision_node in another place * Grammar
Time spent on this ticket should be charged to a specific code. Ask @MoseleyS.
As Enhancing Post Processing Science Lead, I want the IMPROVER weather code plugin to be refactored so that I can run a precipitation type code configuration.
The essential changes are around metadata. The output cube name and categorical attributes are now derived from the decision tree, which has been updated as a result and is now also a required input to the modal categories plugin.
To achieve this, I have done some refactoring:
categorical
wxcode
->categorical
wxcode-modal
->categorical-modes
wxtree
todecision-tree
WeatherSymbols
->ApplyDecisionTree
ModalWeatherCode
->ModalCategory
Acceptance test data updates in metoppv/improver_test_data#28
For reviewing, I recommend looking in two parts:
This PR MUST be merged with the accompanying suite PR: (https://github.com/MetOffice/improver_suite/pull/1823)
Testing: