Skip to content

Split regional historical recipes into model and reference runs#460

Open
bouweandela wants to merge 8 commits intoClimate-REF:mainfrom
bouweandela:split-regional-historical-recipes
Open

Split regional historical recipes into model and reference runs#460
bouweandela wants to merge 8 commits intoClimate-REF:mainfrom
bouweandela:split-regional-historical-recipes

Conversation

@bouweandela
Copy link
Contributor

@bouweandela bouweandela commented Oct 10, 2025

Description

Split regional historical recipes into model and reference runs and preprocess all regions in one go. This avoids loading the data multiple times and rerunning relatively expensive computations to compute the reference for each model. The downside is that the plots created by ESMValTool now will only contain the model or reference, so it is up to the REF portal to create a series figure where both are visible.

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 89.70588% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...valtool/diagnostics/regional_historical_changes.py 92.18% 3 Missing and 2 partials ⚠️
packages/climate-ref/src/climate_ref/solver.py 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
...ef-esmvaltool/src/climate_ref_esmvaltool/recipe.py 92.98% <100.00%> (ø)
packages/climate-ref/src/climate_ref/solver.py 96.61% <0.00%> (-0.57%) ⬇️
...valtool/diagnostics/regional_historical_changes.py 95.41% <92.18%> (-2.53%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bouweandela bouweandela force-pushed the split-regional-historical-recipes branch from 563b49b to 79c96fd Compare February 4, 2026 16:49
@bouweandela bouweandela force-pushed the split-regional-historical-recipes branch from bbdb54b to fda40b4 Compare February 5, 2026 08:21
@bouweandela bouweandela force-pushed the split-regional-historical-recipes branch from ad31ec8 to a8fd54b Compare February 5, 2026 08:37
@bouweandela bouweandela marked this pull request as ready for review February 5, 2026 11:33
if not isinstance(requirement, DataRequirement):
raise TypeError(f"Expected a DataRequirement, got {type(requirement)}")
if requirement.source_type not in data_catalog:
raise InvalidDiagnosticException(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test cases fail with this exception because they are run with a catalog that only contains CMIP6 or obs4MIPs data, not both, so I downgraded this to a debug message.

Copy link
Contributor

Choose a reason for hiding this comment

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

That is fine. I think this isn't possible for a user using the CLI

if not isinstance(requirement, DataRequirement):
raise TypeError(f"Expected a DataRequirement, got {type(requirement)}")
if requirement.source_type not in data_catalog:
raise InvalidDiagnosticException(
Copy link
Contributor

Choose a reason for hiding this comment

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

That is fine. I think this isn't possible for a user using the CLI

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