-
Notifications
You must be signed in to change notification settings - Fork 100
Mobt775 Add SAMOS apply plugins and all CLIs #2153
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
Conversation
… type-hinting for both classes. Add unit tests for both classes.
…in and add calculate_cube_statistics method.
…lculation over time coordinate. Add tests for this method.
…tions for SAMOS. Move generic helper functions for SAMOS unit tests into their own file. Create TrainEMOSForSAMOS class. Create additional unit tests for TrainGAMsForSAMOS. Add scipy monkey patch to pygam imports to work around a known bug.
…orSAMOS to use 2 methods which include all functionality. Add unit tests for TrainEMOSForSAMOS. Minor update to CalculateClimateAnomalies.
…ference_epoch coordinate bounds when the inputs have multiple time points.
…erstand. Improve test of TrainGAMsForSAMOS by predicting from the fitted GAM and comparing the predictions to expected output.
…evant file where there are only used in one file. Improve argument names for some test helper functions. Run pre-commit to fix formatting errors.
…7 production environment, as described in metoppv#2124.
… its own function. Move unit tests accordingly. Respecify expected results of unit tests which use this function, as the random number generation has changed. Create ApplySAMOS class. Formatting changes.
…CLIs for 3 SAMOS classes and add helper function for splitting input cubes to these CLIs. Modify apply EMOS so that it can return location and scale parameters. Move functionality for converting location and scale parameters to forecast values out of apply EMOS plugin. Various small fixes.
…s. Modify calculation of means and standard deviations of cubes in GAMs to collapse over time coordinates.
gavinevans
left a comment
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 a few more comments.
improver_tests/acceptance/test_estimate_samos_gams_from_table.py
Outdated
Show resolved
Hide resolved
gavinevans
left a comment
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 👍
This looks fine to me.
improver/utilities/cli_utilities.py
Outdated
| A list of contained pickled objects. | ||
| or | ||
| None |
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.
Could these lines be rewritten in both functions as 'A list of contained pickle objects, or None.'?
improver_tests/acceptance/test_estimate_samos_gams_from_table.py
Outdated
Show resolved
Hide resolved
maxwhitemet
left a comment
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.
Happy with the changes made. Approved 👍
…tering * upstream/master: Minor correction to write the output file from the test_gam_at_sites acceptance test to a temporary location, as usual. (metoppv#2204) Adds option for a landmask ancillary to be passed into the CLI (metoppv#2202) Mobt775 Add SAMOS apply plugins and all CLIs (metoppv#2153) Recursive filter mask zeros modifications (metoppv#2199) Correct passing through of variables for QRF application (metoppv#2196)
Addresses https://github.com/metoppv/mo-blue-team/issues/775
Acceptance test data: metoppv/improver_test_data#108
Add plugins for applying a pre-trained SAMOS model to a new forecast. This PR follows on from #2126. I've rebased this branch on master now that the initial training plugin PR has been merged.
This PR now contains an amalgamation of various branches created to add plugins required to apply SAMOS calibration as well as all CLIs for SAMOS calibration.
Testing: