Skip to content

Apply realization clustering result to any lead time#2340

Merged
mo-jbeaver merged 10 commits intometoppv:masterfrom
gavinevans:mobt_1073_apply_clustering2
Apr 17, 2026
Merged

Apply realization clustering result to any lead time#2340
mo-jbeaver merged 10 commits intometoppv:masterfrom
gavinevans:mobt_1073_apply_clustering2

Conversation

@gavinevans
Copy link
Copy Markdown
Contributor

Addresses https://github.com/metoppv/mo-blue-team/issues/1073
Related to: #2259

Description
This PR adds a plugin and CLI that applies the result of the realization clustering that was diagnosed as part of the RealizationClusterAndMatch plugin to a set of forecasts, likely from a forecast period that was not included within the initial realization clustering. This allows the RealizationClusterAndMatch plugin to take a subset of all lead times to diagnose the realization clustering with the RealizationSelection plugin then being used to apply the clustering and matching to other lead times. To support this work, an additional attribute has been added to the RealizationClusterAndMatch plugin: primary_input_realization_to_cluster_medoid, so that the cluster medoid is recorded for "primary input" e.g. the forecast source available to the longest lead time and, therefore the forecast source that was clustered as part of the RealizationClusterAndMatch plugin.

Testing:

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

Copy link
Copy Markdown
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.

Nicely done @gavinevans. I've added some minor comments. An aside: the branch needs to be rebased.

Comment thread improver_tests/acceptance/test_realization_cluster_and_match.py
Comment thread improver/cli/realization_selection.py
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver/clustering/realization_clustering.py
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver/clustering/realization_clustering.py
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver_tests/acceptance/acceptance.py Outdated
maxwhitemet
maxwhitemet previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
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.

Thanks Gavin. Happy with the changes made so approved. I've added some very minor comments that shouldn't stop this work from moving to second review.

Comment thread improver_tests/clustering/test_realization_clustering.py Outdated
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver_tests/clustering/test_realization_clustering.py Outdated
Comment thread improver/cli/realization_selection.py Outdated
Comment thread improver/cli/realization_selection.py Outdated
maxwhitemet
maxwhitemet previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
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.

Thanks @gavinevans. Happy with the changes made. Approved 👍

Copy link
Copy Markdown
Contributor

@mo-jbeaver mo-jbeaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments added about potential things to include.
Tests ran successfully.

Comment thread improver/cli/realization_selection.py Outdated
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver/clustering/realization_clustering.py
Comment thread improver/clustering/realization_clustering.py
Comment thread improver/clustering/realization_clustering.py
Comment thread improver/clustering/realization_clustering.py Outdated
Comment thread improver_tests/acceptance/test_realization_cluster_and_match.py Outdated
Comment thread improver_tests/acceptance/test_realization_cluster_and_match.py Outdated
Copy link
Copy Markdown
Contributor

@mo-jbeaver mo-jbeaver 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 all the changes and tests ran successfully.

@mo-jbeaver mo-jbeaver merged commit b2a8d51 into metoppv:master Apr 17, 2026
7 checks passed
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.

3 participants