Modifications to support cold start without a primary input for realization clustering - #2455
Conversation
maxwhitemet
left a comment
There was a problem hiding this comment.
Hi @gavinevans. I have added a few light comments
| None: If no primary cube is found for the configured primary input, | ||
| indicating a cold-start or no-primary condition that should be skipped. |
There was a problem hiding this comment.
Please could you clarify what a 'cold-start' and 'no-primary' condition is and when it would arise. I'm wondering if this is specific to our suite setup
There was a problem hiding this comment.
I've removed this jargon in favour of some simpler wording.
| output_path, | ||
| ] | ||
|
|
||
| with pytest.warns(UserWarning, match=r"No primary cube found"): |
There was a problem hiding this comment.
I don't think the raw string formatting is required here or in the warning matching below, however this is safe long-term.
| with pytest.warns(UserWarning, match=r"No primary cube found"): | |
| with pytest.warns(UserWarning, match="No primary cube found"): |
| def test_clusterandmatch_process_no_primary_cube(): | ||
| """Test that ValueError is raised if no primary cube is found with the specified model_id_attr.""" | ||
| # Only secondary input cubes, no primary input | ||
| """Test that a missing primary cube is treated as a cold-start no-op.""" |
There was a problem hiding this comment.
Please could 'cold-start no-op' be defined?
There was a problem hiding this comment.
I've simplified this docstring.
maxwhitemet
left a comment
There was a problem hiding this comment.
Thanks @gavinevans. Happy to approve.
mo-jbeaver
left a comment
There was a problem hiding this comment.
Happy to approve, all tests ran successfully.
Addresses https://github.com/metoppv/mo-blue-team/issues/1290
Description
This PR removes the exception that was noted on https://github.com/MetOffice/improver_suite/pull/2840 as problematic in a cold start situation where the primary input is not yet available. This PR removes the exception and replaces it with a warning, which therefore returns None.
Testing: