Skip to content

Fix transition pair absence - #2457

Merged
gavinevans merged 6 commits into
metoppv:masterfrom
gavinevans:mobt_1291_fix_transition_pair_absence
Oct 2, 2026
Merged

gavinevans merged 6 commits into
metoppv:masterfrom
gavinevans:mobt_1291_fix_transition_pair_absence

Conversation

@gavinevans

@gavinevans gavinevans commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Addresses https://github.com/metoppv/mo-blue-team/issues/1293

Description
This PR addressed a minor issue that can occur in spin-up where the inputs for a specified transition in the SpatialMorphing plugin are both absent. For example, if the transitions dictionary is defined as below, but only source_c is available, the SpatialMorphing plugin will currently fail, as a transition is defined, but neither of the source pair is available. This PR adds more leniency, so that if source_a and source_b are both absent then the plugin will fallback to source_c.

{
    "transitions": [
        {
            "source_a": "source_a",
            "source_b": "source_b",
            "start_forecast_period_minutes": 60,
            "end_forecast_period_minutes": 240
        }
}

Testing:

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

@mo-jbeaver mo-jbeaver left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've added some comments below, but all tests ran successfully.
Additionally, is there a fall back for it source_b isn't available and we can't default back to source_a as it is not available anymore (i.e. If it doesn't produce forecasts at that lead time.)?

Comment thread improver/utilities/spatial_morphing.py Outdated
Comment thread improver/utilities/spatial_morphing.py Outdated
Comment thread improver/utilities/spatial_morphing.py
Comment thread improver/utilities/spatial_morphing.py Outdated
Comment thread improver_tests/utilities/test_SpatialMorphing.py
maxwhitemet
maxwhitemet previously approved these changes Oct 1, 2026

@maxwhitemet maxwhitemet left a comment

Copy link
Copy Markdown
Contributor

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 👍

@mo-jbeaver mo-jbeaver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added a few more questions below for some clarification, but all the tests passed successfully.

Comment thread improver/utilities/spatial_morphing.py Outdated
Comment thread improver/utilities/spatial_morphing.py Outdated
Comment thread improver/utilities/spatial_morphing.py Outdated
Comment thread improver_tests/utilities/test_SpatialMorphing.py Outdated

@mo-jbeaver mo-jbeaver left a comment

Copy link
Copy Markdown
Contributor

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, thanks.

@gavinevans
gavinevans merged commit 7505d2e into metoppv:master Oct 2, 2026
7 checks passed
@gavinevans
gavinevans deleted the mobt_1291_fix_transition_pair_absence branch October 2, 2026 11:58
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