Skip to content

Support deterministic forecast source when clustering - #20

Open
gavinevans wants to merge 2 commits into
mobt_783_partial_realization_clusteringfrom
mobt_783_deterministic_secondary_inputs
Open

Support deterministic forecast source when clustering#20
gavinevans wants to merge 2 commits into
mobt_783_partial_realization_clusteringfrom
mobt_783_deterministic_secondary_inputs

Conversation

@gavinevans

Copy link
Copy Markdown
Owner

Description
This PR makes some modifications on top of metoppv#2417 to support including a truly deterministic forecast in the RealizationClusterAndMatch plugin. Some (deterministic) models are time-lagged, so still have a realization coordinate and dimension when provided to RealizationClusterAndMatch. Some forecast sources are, however, truly deterministic e.g. a deterministic nowcast and therefore don't have a realization coordinate. This PR therefore adds handling for these deterministic inputs, so that they can be included as a secondary input in the RealizationClusterAndMatch plugin as expected.

Testing:

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

…ch step. Add warnings if either an input is provided but not defined in the hierarchy, or if an input is defined in the hierarchy but not provided. This should avoid the processing silently skipping inputs due to a misconfiguration of the hierarchy.

@mo-jbeaver mo-jbeaver left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@gavinevans I've added a few comments for extra clarification could be added but, all the tests ran successfully.

Comment on lines 750 to 754
@@ -723,10 +753,18 @@ def _categorise_secondary_inputs(
# all periods for this source mergeable for consistent multi-period
# matching.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can this be updated to include the additions from the if else statements

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Added a sentence.


This verifies that when extra cubes are supplied with a model_id attribute value
that does not appear in the hierarchy (neither as primary_input nor as a secondary
input key), the plugin warns that those cubes will be ignored.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there a way to check, or is it important to test, that these cubes are ignored?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I've added an assertion that the unlisted_model is absent from the attributes.

Comment on lines +3172 to +3174
When a secondary input cube has no realization coordinate it should be treated
as having a single realization and follow the partial-realization path, replacing
the best-matching cluster at the relevant forecast periods with its data.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can something be added here to explain the primary input sections of this test a bit more.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Added a sentence.

@gavinevans gavinevans assigned gavinevans and unassigned gavinevans Aug 3, 2026

@mo-jbeaver mo-jbeaver left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Happy with the updates made and the tests all ran successfully.

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.

2 participants