Skip to content

Make ECS diagnostic compatible with CMIP7 data#671

Merged
lewisjared merged 13 commits into
Climate-REF:mainfrom
schlunma:ecs_cmip7
Jun 30, 2026
Merged

Make ECS diagnostic compatible with CMIP7 data#671
lewisjared merged 13 commits into
Climate-REF:mainfrom
schlunma:ecs_cmip7

Conversation

@schlunma

@schlunma schlunma commented May 13, 2026

Copy link
Copy Markdown
Contributor

Description

Addresses #647.

Checklist

Please confirm that this pull request has done the following:

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

Summary by CodeRabbit

  • Bug Fixes
    • Updated ECS diagnostics to work with CMIP7 data, improving dataset selection and configuration.
    • Corrected branding/label handling for ECS inputs to ensure consistent dataset metadata across CMIP6 and CMIP7.
  • Documentation
    • Added a changelog entry for the CMIP7 ECS diagnostic update.
    • Refreshed the shipped ECS reference recipe assets used by examples/recipe listings.

@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
core 92.30% <ø> (ø)
providers 86.28% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...tool/src/climate_ref_esmvaltool/diagnostics/ecs.py 84.09% <100.00%> (-0.53%) ⬇️
...ef-esmvaltool/src/climate_ref_esmvaltool/recipe.py 86.82% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@schlunma schlunma marked this pull request as ready for review May 20, 2026 13:16
@schlunma

Copy link
Copy Markdown
Contributor Author

2 questions:

  • Is it ok to point the ESMValTool commit hash to a feature branch or should this point to a commit in main? In other words, does Add CMIP7-compatible REF version of recipe_ecs.yml ESMValGroup/ESMValTool#4465 need to be merged before this?
  • Running the test cases with ref test-cases run --provider esmvaltool --diagnostic equilibrium-climate-sensitivity --fetch --force-regen --clean creates a packages/climate-ref-esmvaltool/tests/test-data/ in my repository which is not gitignored. Is this a deliberate choice?

@bouweandela

Copy link
Copy Markdown
Contributor

Is it ok to point the ESMValTool commit hash to a feature branch or should this point to a commit in main?

Using a feature branch is fine for testing, but the commit should be in ESMValTool's main branch before this pull request can be merged.

@schlunma schlunma marked this pull request as draft May 22, 2026 10:39
@schlunma

Copy link
Copy Markdown
Contributor Author

Will mark this as "ready for review" once corresponding ESMValTool PR has been merged.

@schlunma schlunma marked this pull request as ready for review May 29, 2026 12:11
@schlunma

Copy link
Copy Markdown
Contributor Author

This is ready for review now.

@lewisjared

Copy link
Copy Markdown
Contributor

I'm currently reworking how we track regression outputs from new diagnostics and I'm keen to try these PRs with the new system so... just a bit longer...

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eeaef205-83ba-4daf-a0a6-ed999d590ee4

📥 Commits

Reviewing files that changed from the base of the PR and between 95a006c and adf3752.

📒 Files selected for processing (2)
  • packages/climate-ref-esmvaltool/tests/test-data/equilibrium-climate-sensitivity/cmip6/manifest.json
  • packages/climate-ref-esmvaltool/tests/test-data/equilibrium-climate-sensitivity/cmip7/manifest.json
✅ Files skipped from review due to trivial changes (1)
  • packages/climate-ref-esmvaltool/tests/test-data/equilibrium-climate-sensitivity/cmip7/manifest.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/climate-ref-esmvaltool/tests/test-data/equilibrium-climate-sensitivity/cmip6/manifest.json

📝 Walkthrough

Walkthrough

The ECS diagnostic now uses a new ref recipe and unified dataset construction for CMIP6 and CMIP7. Package metadata, fixtures, and CMIP7 test data were updated, and the changelog records CMIP7 support.

Changes

ECS CMIP7 Diagnostics Support

Layer / File(s) Summary
Base recipe and ESMValTool version update
packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ecs.py, packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipes.txt, packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/recipe.py
EquilibriumClimateSensitivity.base_recipe switches to ref/recipe_ref_ecs.yml with a reduced variables tuple; recipes.txt registers the new ref recipe and updates the ozone hash; the pinned ESMValTool commit hash is updated.
Unified update_recipe dataset construction
packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ecs.py
update_recipe removes CMIP6/CMIP7 branching and per-variable additional_datasets, derives cmip_source, builds recipe["datasets"] from tas rows with get_child_and_parent_dataset, and strips branding_suffix from dataset entries and CMIP6 diagnostic variables.
Expected recipe fixtures and test data
packages/climate-ref-esmvaltool/tests/unit/diagnostics/recipes/recipe_equilibrium_climate_sensitivity_cmip*.yml, packages/climate-ref-esmvaltool/tests/test-data/equilibrium-climate-sensitivity/cmip6/manifest.json, packages/climate-ref-esmvaltool/tests/test-data/equilibrium-climate-sensitivity/cmip7/*, changelog/671.fix.md
The CMIP6 recipe fixture reorders preprocessors and diagnostics after datasets and reorders rtnt fields; the CMIP7 recipe fixture adds top-level datasets and removes per-variable additional_datasets; the CMIP6 manifest is refreshed; the CMIP7 catalogue, manifest, and regression artefacts are added; the changelog adds the ECS CMIP7 note.

Possibly related PRs

  • Climate-REF/climate-ref#764: Both changes touch get_child_and_parent_dataset and the ECS-related recipe timerange handling used to derive parent datasets.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: ECS diagnostic support for CMIP7 data.
Description check ✅ Passed The description matches the template with a Description section and a completed checklist for tests, documentation, and changelog.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Pin ESMValTool to 12cb5309 so the shared recipe.py pin matches the TCRE
CMIP7 branch and does not conflict at merge, and bump the ECS diagnostic
version to 2 because the CMIP7 changes alter results and must trigger
recomputation.
name = "Equilibrium Climate Sensitivity"
slug = "equilibrium-climate-sensitivity"
base_recipe = "recipe_ecs.yml"
version = 2

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.

@schlunma @bouweandela Diagnostic.version is an integer field that can be used to mark a diagnostic to being rerun from scratch on the next solve.

The old executions are still present in the database if needed, but the API only serves results from the latest diagnostic version.

Mint native baselines for the equilibrium-climate-sensitivity test cases
against ESMValTool 12cb5309. CMIP6 gains a native baseline and bumps to
test_case_version 2; CMIP7 is seeded at version 1. Both replay and match
the committed bundle.
* origin/main:
  docs: simplify gate comments and regression docs
  fix(test-cases): migrate-manifests preserves recorded diagnostic_version
  fix: backfill diagnostic_version for baselines merged from main
  docs: rename changelog entry to PR number 770
  feat(regression): couple Diagnostic.version into the CI coupling gate
  feat(example): extract model/reference/bias time series as CMEC series
  refactor(example): rename diagnostic to global-sst-bias and drop version guard
  test: close NetCDF datasets in surface-temperature end-to-end tests
  feat(example): use ocean SST (tos) and add comparison figures
  test(example): mint regression baselines for surface-temperature-bias
  fix: address review feedback on surface temperature diagnostic
  test: update solver regression snapshots for new example diagnostic
  feat(example): add model-vs-obs surface temperature diagnostic and 5-minute quickstart
  fix: address review feedback
  chore: add changelog for config CLI uplift
  feat: expand config CLI management commands

# Conflicts:
#	packages/climate-ref-esmvaltool/tests/test-data/equilibrium-climate-sensitivity/cmip6/manifest.json
After merging main (which added the diagnostic_version gate and backfilled
manifests to schema 2), migrate the ECS baselines to record
diagnostic_version 2, matching the in-code Diagnostic.version. Both test
cases replay-match the committed bundle and the CI gate selects replay.
@lewisjared lewisjared merged commit b236908 into Climate-REF:main Jun 30, 2026
21 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