Skip to content

Comments

fix: regression fixes for CMIP6-to-CMIP7 conversion and supplementary dataset selection#553

Closed
lewisjared wants to merge 31 commits intoremove-out-namefrom
fix/regression-versions
Closed

fix: regression fixes for CMIP6-to-CMIP7 conversion and supplementary dataset selection#553
lewisjared wants to merge 31 commits intoremove-out-namefrom
fix/regression-versions

Conversation

@lewisjared
Copy link
Contributor

Description

A collection of fixes addressing regression issues in the CMIP6-to-CMIP7 conversion pipeline and supplementary dataset selection logic:

  • Refactor DReq variable handling and filename generation — restructured how Data Request variables are mapped and filenames are generated
  • Fix CMIP6-to-CMIP7 variant index parsing — correctly parse variant indexes during conversion
  • Handle spurious extra coordinates — explicitly handle extra coordinates that appear in some datasets
  • Apply version filtering to regression analysis — ensure version constraints are respected during regression solving
  • Select single supplementary dataset per matching group — the AddSupplementaryDataset.apply method could select multiple supplementary datasets (e.g. areacella) for the same model when different main datasets in the group preferred different supplementaries due to score ties. Changed iteration from per-unique-facet-combination to per-matching_facets-group, scoring each candidate against ALL main datasets and taking the max score. This eliminates spurious experiment entries (1pctCO2, esm-1pct-brch-1000PgC, hist-GHG) from appearing alongside expected historical + SSP data.
  • Regenerated regression YAML outputs to reflect the corrected supplementary selection

Checklist

Please confirm that this pull request has done the following:

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

lee1043 and others added 30 commits October 13, 2025 19:49
PMP annual cycle: make flexible timestamp
- Simplified the extraction of variable mappings from the CMIP7 Data Request
- Removed out_name usages
Two bugs caused non-r1i1p1f1 datasets to always produce r1i1p1f1:

1. convert_variant_index() used isinstance(value, int) which missed
   numpy integer types (np.int32, np.int64) from netCDF attributes,
   falling through to the default return of f"{prefix}1"

2. convert_cmip6_to_cmip7_attrs() defaulted all missing individual
   indexes to 1 and rebuilt variant_label from those defaults,
   overwriting the correct variant_label even when it was present

Fix: parse variant_label as fallback when individual indexes are
missing, and handle numpy integer types in convert_variant_index().
@lewisjared lewisjared changed the base branch from main to remove-out-name February 20, 2026 12:06
@lewisjared lewisjared closed this Feb 20, 2026
lewisjared added a commit that referenced this pull request Feb 20, 2026
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 94.91525% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...te-ref-core/src/climate_ref_core/cmip6_to_cmip7.py 93.22% 4 Missing ⚠️
...f-celery/src/climate_ref_celery/celeryconf/base.py 90.47% 1 Missing and 1 partial ⚠️
Flag Coverage Δ
core 92.56% <94.87%> (+0.10%) ⬆️
providers 89.65% <100.00%> (ø)

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

Files with missing lines Coverage Δ
...mate-ref-celery/src/climate_ref_celery/executor.py 97.56% <100.00%> (ø)
...-ref-celery/src/climate_ref_celery/worker_tasks.py 100.00% <100.00%> (ø)
...imate-ref-core/src/climate_ref_core/constraints.py 96.75% <100.00%> (+0.04%) ⬆️
...limate-ref-core/src/climate_ref_core/esgf/cmip7.py 93.85% <100.00%> (+0.05%) ⬆️
...mp/src/climate_ref_pmp/diagnostics/annual_cycle.py 63.90% <100.00%> (ø)
...kages/climate-ref/src/climate_ref/datasets/base.py 98.47% <100.00%> (+0.04%) ⬆️
...ages/climate-ref/src/climate_ref/datasets/cmip7.py 80.30% <ø> (ø)
...ages/climate-ref/src/climate_ref/models/dataset.py 98.93% <ø> (ø)
...kages/climate-ref/src/climate_ref/solve_helpers.py 98.92% <100.00%> (+0.02%) ⬆️
...f-celery/src/climate_ref_celery/celeryconf/base.py 93.33% <90.47%> (-6.67%) ⬇️
... and 1 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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