Skip to content

Conversation

@lewisjared
Copy link
Contributor

@lewisjared lewisjared commented Feb 11, 2026

Summary

  • Add CMIP7 DataRequirement entries alongside existing CMIP6 ones for all three PMP diagnostic families (annual cycle, ENSO, variability modes)
  • Update make_data_requirement / _get_data_requirements helpers to accept a source_type parameter and use variant_label instead of member_id for CMIP7 group-by facets
  • Add TestDataSpecification with CMIP6 and CMIP7 test cases for each diagnostic, using CMIP6Request, CMIP7Request, and Obs4MIPsRequest

Test plan

  • Verify PMP provider tests pass: make test-diagnostic-pmp

…tics

Add CMIP7 as an alternative source type alongside CMIP6 for all PMP
diagnostics (AnnualCycle, ENSO, ExtratropicalModesOfVariability).
Each diagnostic now returns tuple-of-tuples data_requirements with
both CMIP6 and CMIP7 options, and includes test_data_spec with test
cases for both source types.
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 95.91837% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../climate-ref-pmp/src/climate_ref_pmp/pmp_driver.py 75.00% 1 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
...mp/src/climate_ref_pmp/diagnostics/annual_cycle.py 63.69% <100.00%> (+0.88%) ⬆️
...te-ref-pmp/src/climate_ref_pmp/diagnostics/enso.py 98.71% <100.00%> (+0.03%) ⬆️
...c/climate_ref_pmp/diagnostics/variability_modes.py 88.37% <100.00%> (+1.19%) ⬆️
.../climate-ref-pmp/src/climate_ref_pmp/pmp_driver.py 78.40% <75.00%> (-0.35%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…ariable/obs pairs

Instead of duplicating each make_data_requirement call for CMIP6 and CMIP7,
the helper now returns both pairs and the class flattens them via a generator.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds CMIP7 support to REF-PMP diagnostics by extending data requirements and defining fetchable test-case specifications, alongside existing CMIP6 behavior.

Changes:

  • Add CMIP7 DataRequirement alternatives (using variant_label for grouping) for ENSO and variability-modes diagnostics.
  • Extend annual-cycle helper to parameterize model SourceDatasetType (CMIP6 vs CMIP7) and add CMIP7 requirements across variables.
  • Introduce TestDataSpecification/TestCase definitions for CMIP6 and CMIP7 inputs for PMP diagnostics.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/annual_cycle.py Parameterizes model source type in make_data_requirement, adds CMIP7 requirement variants, and adds test-case requests.
packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/enso.py Adds CMIP7 requirement variant and defines CMIP6/CMIP7 + Obs4MIPs test-case requests.
packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/variability_modes.py Adds CMIP7 requirement variant and defines CMIP6/CMIP7 + Obs4MIPs test-case requests for modes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add get_model_source_type helper to pmp_driver for detecting CMIP6 vs CMIP7
- Update build_cmd/build_cmds and build_execution_result in all three
  PMP diagnostics to use the detected model source type instead of
  hard-coding SourceDatasetType.CMIP6
- Use variant_label instead of member_id when running CMIP7 data
- Add RegistryRequest for PMPClimatology reference data in annual cycle
  test data specifications
@lewisjared lewisjared changed the title feat: add CMIP7 data requirements and test data specs for PMP diagnostics feat(pmp): add CMIP7 data requirements and test data specs for PMP diagnostics Feb 11, 2026
CMIP7 does not use table_id; frequency is the correct facet for filtering.
Replace table_id: Amon with frequency: mon and table_id: fx with frequency: fx
in all CMIP7Request facets.
@lewisjared lewisjared requested a review from lee1043 February 11, 2026 09:02
Obs datasets (HadISST-1-1, 20CR, GPCP-Monthly-3-2, TropFlux-1-0,
CERES-EBAF-4-2) are not available on ESGF but exist in the obs4ref
registry. Switch from Obs4MIPsRequest to RegistryRequest with
registry_name="obs4ref" and source_type="obs4MIPs" so the data
can be fetched while still being accessible via
definition.datasets[SourceDatasetType.obs4MIPs].
@lewisjared
Copy link
Contributor Author

@lee1043

All the added CMIP7 test-cases ran successfully. I'm not checking in the results yet, but its seems to work with CMIP7 formatted data. The output figures contain "CMIP6" is there a way to change that?

e.g. SAM_psl_EOF1_JJA_cmip6_ACCESS-ESM1-5_historical_r1i1p1f1_mo_atm_1900-2005.png

image

…mp-cmip7

* 'pmp-cmip7' of github.com:Climate-REF/climate-ref:
  chore(deps-dev): bump the python-dependencies group with 4 updates
  chore(deps): bump the github-actions group with 2 updates
@lee1043
Copy link
Contributor

lee1043 commented Feb 11, 2026

Hi @lewisjared, thank you for the test!

I am retrieving facet information as like in the following lines:

input_datasets = definition.datasets[SourceDatasetType.CMIP6]
source_id = input_datasets["source_id"].unique()[0]
experiment_id = input_datasets["experiment_id"].unique()[0]
member_id = input_datasets["member_id"].unique()[0]

Could you remind me how I can get mip_id?

Copilot AI review requested due to automatic review settings February 12, 2026 16:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings February 12, 2026 16:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@lee1043
Copy link
Contributor

lee1043 commented Feb 12, 2026

@lewisjared could you please help rerunning your CMIP7-like-data-testing workflow to check the figure files?

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