Skip to content

Conversation

@brhooper
Copy link
Contributor

@brhooper brhooper commented Jul 10, 2025

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:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s)

brhooper and others added 21 commits May 14, 2025 07:13
… 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.
… 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.
@brhooper brhooper changed the title Mobt775 Add SAMOS apply plugins Mobt775 Add SAMOS apply plugins and unit tests Jul 10, 2025
@brhooper brhooper self-assigned this Jul 17, 2025
@brhooper brhooper assigned gavinevans and unassigned brhooper Sep 30, 2025
Copy link
Contributor

@gavinevans gavinevans left a 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.

@gavinevans gavinevans assigned brhooper and unassigned gavinevans Sep 30, 2025
gavinevans
gavinevans previously approved these changes Oct 2, 2025
Copy link
Contributor

@gavinevans gavinevans left a 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.

@gavinevans gavinevans removed their assignment Oct 2, 2025
Comment on lines 41 to 43
A list of contained pickled objects.
or
None
Copy link
Contributor

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.'?

@maxwhitemet maxwhitemet assigned brhooper and unassigned maxwhitemet Oct 7, 2025
Copy link
Contributor

@maxwhitemet maxwhitemet left a 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 👍

@maxwhitemet maxwhitemet removed their assignment Oct 8, 2025
@gavinevans gavinevans merged commit 9fde670 into metoppv:master Oct 8, 2025
7 checks passed
gavinevans added a commit to gavinevans/improver that referenced this pull request Oct 10, 2025
…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)
@gavinevans gavinevans mentioned this pull request Oct 10, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants