Skip to content

Install pcmdi_metrics from a fork of 4.2.0 with a chunked variability-modes SVD - #901

Open
lewisjared wants to merge 7 commits into
mainfrom
pmp-fix
Open

Install pcmdi_metrics from a fork of 4.2.0 with a chunked variability-modes SVD#901
lewisjared wants to merge 7 commits into
mainfrom
pmp-fix

Conversation

@lewisjared

@lewisjared lewisjared commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Installs pcmdi_metrics from a fork of 4.2.0 that chunks the SVD in the variability modes analysis. This cuts the runtime of the extratropical modes of variability diagnostics by roughly 40x.

The fork is pinned to commit d0a79e5 on lewisjared/pcmdi_metrics@fix/variability-modes-dask-svd-memory, two commits ahead of upstream 4.2.0. It follows the pattern the ESMValTool provider already uses: conda installs the released package for its dependencies, then pip installs the fork over the top with --no-deps. The conda pin stays at 3.9.2, so the diagnostics run 4.2.0 code on a 3.9.2 dependency set. That mismatch is deliberate and tracked in #906, because moving the conda pin to 4.2.0 pulls enso_metrics 2.0.0, whose CDAT to xarray migration breaks EnsoFbSstTaux and fails both enso_proc cases.

Diagnostic.version is bumped on all three PMP diagnostics, and all 22 baselines are re-minted from run 33721507480.

Things worth a close look.

Summary by CodeRabbit

  • New Features

    • Annual-cycle diagnostics now provide monthly metric series, including pressure-level results.
    • Extratropical modes-of-variability analysis runs approximately 40 times faster.
  • Bug Fixes

    • Corrected modes-of-variability regression calculations, spatial masking, and latitude ordering.
    • Updated variability-modes and annual-cycle metrics to reflect corrected results.
    • Updated ENSO and variability-modes reference data selections.
  • Tests

    • Refreshed diagnostic outputs, reference values, versions, checksums, and metadata across supported CMIP6 and CMIP7 test cases.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: c49110a5-14ad-453a-9725-5ba6c85a9cfc

📥 Commits

Reviewing files that changed from the base of the PR and between 5d99685 and 2d05583.

📒 Files selected for processing (34)
  • packages/climate-ref-pmp/src/climate_ref_pmp/__init__.py
  • packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/annual_cycle.py
  • packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/enso.py
  • packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/variability_modes.py
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-pr/manifest.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-ta/manifest.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-ts/manifest.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip7-ts/manifest.json
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nam/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nam/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nam/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nam/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nao/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nao/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npgo/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npgo/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npgo/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npgo/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npo/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npo/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pna/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pna/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-sam/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-sam/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-sam/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-sam/cmip7/regression/diagnostic.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip7-ts/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip7/regression/diagnostic.json

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PMP provider now installs a pinned pcmdi_metrics 4.2.0 fork and applies default thread limits. Annual-cycle diagnostics retain monthly CalendarMonths values as series. Diagnostic versions and regenerated ENSO and variability-mode reference data are updated.

Changes

PMP diagnostics and reference data

Layer / File(s) Summary
PMP pin and thread-limit configuration
packages/climate-ref-pmp/src/climate_ref_pmp/__init__.py
The provider installs the pinned pcmdi_metrics fork and sets OpenMP and BLAS thread variables to 2 when no thread budget is configured.
Annual-cycle monthly series
packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/annual_cycle.py, packages/climate-ref-pmp/tests/unit/test_annual_cycle.py, packages/climate-ref-pmp/tests/test-data/annual-cycle/...
The annual-cycle diagnostic extracts monthly values into series, adds pressure-level dimensions when present, and passes the series into the execution result. Regression fixtures and manifests record the new series and regenerated outputs.
ENSO diagnostic and reference refresh
packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/enso.py, packages/climate-ref-pmp/tests/test-data/enso_proc/..., packages/climate-ref-pmp/tests/test-data/enso_tel/...
ENSO requests use obs4REF, diagnostic version 3 is recorded, and regenerated artefact metadata records PMP 4.2.0.
Variability-mode diagnostic and reference refresh
packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/variability_modes.py, packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-*/...
HadISST requests use obs4REF, diagnostic version 4 is recorded, and NAM, NAO, NPGO, NPO, PDO, PNA, and SAM fixtures contain regenerated metrics and artefact metadata.
Changelog entries
changelog/901.fix.md, changelog/901.feature.md
The changelog records the pinned fork, corrected diagnostic outputs, and retained annual-cycle monthly series.

Merge Risk: 🟡 Moderate · up to 2d055

This update installs a PMP fork over the existing conda package to improve diagnostic performance and refreshes diagnostic outputs. Merge readiness depends on confirming that the overlay preserves the intended dependency set; otherwise ENSO processing may fail at runtime.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. (30 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: installing pcmdi_metrics 4.2.0 from a fork with a chunked variability-modes SVD.
Description check ✅ Passed The description gives detailed technical context, explains the dependency pin, records the performance benefit, identifies risks, and states that a changelog entry and test baseline updates are includ…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. (30 skipped: 30 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pmp-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@lewisjared
lewisjared marked this pull request as ready for review September 3, 2026 05:47
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.53659% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...mp/src/climate_ref_pmp/diagnostics/annual_cycle.py 52.77% 12 Missing and 5 partials ⚠️
Flag Coverage Δ
core 94.00% <ø> (+0.17%) ⬆️
providers 87.41% <58.53%> (+2.93%) ⬆️

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

Files with missing lines Coverage Δ
...es/climate-ref-pmp/src/climate_ref_pmp/__init__.py 100.00% <100.00%> (ø)
...te-ref-pmp/src/climate_ref_pmp/diagnostics/enso.py 79.26% <100.00%> (ø)
...c/climate_ref_pmp/diagnostics/variability_modes.py 89.28% <100.00%> (ø)
...mp/src/climate_ref_pmp/diagnostics/annual_cycle.py 46.07% <52.77%> (+0.56%) ⬆️

... and 26 files with indirect coverage changes

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

@lewisjared
lewisjared deployed to native-baselines September 3, 2026 06:03 — with GitHub Actions Active
@lewisjared lewisjared changed the title Install pcmdi_metrics from a fork with a chunked variability-modes SVD Move the PMP provider to pcmdi_metrics 4.2.0 with a chunked variability-modes SVD Sep 3, 2026
@lewisjared

Copy link
Copy Markdown
Contributor Author

This will invalidate the existing pmp runs so we should bump with #898

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-pr/regression/diagnostic.json (1)

85-85: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Re-mint the PMP provenance files with NumPy 2.2.6.

The conda lock file resolves NumPy 2.2.6, but the diagnostic and output provenance files record NumPy 2.0.2. Update all affected annual-cycle provenance fixtures.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 1f2b2738-29fc-4662-a18a-c7d5aceeda85

📥 Commits

Reviewing files that changed from the base of the PR and between 36b9794 and c378717.

📒 Files selected for processing (59)
  • changelog/901.fix.md
  • packages/climate-ref-pmp/src/climate_ref_pmp/__init__.py
  • packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/annual_cycle.py
  • packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/enso.py
  • packages/climate-ref-pmp/src/climate_ref_pmp/diagnostics/variability_modes.py
  • packages/climate-ref-pmp/src/climate_ref_pmp/requirements/conda-lock.yml
  • packages/climate-ref-pmp/src/climate_ref_pmp/requirements/environment.yml
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-pr/manifest.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-pr/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-pr/regression/output.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-ta/manifest.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-ta/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-ta/regression/output.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-ts/manifest.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-ts/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip6-ts/regression/output.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip7-ts/manifest.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip7-ts/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/annual-cycle/cmip7-ts/regression/output.json
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip6/regression/output.json
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/output.json
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/output.json
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/output.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nam/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nam/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nam/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nam/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nao/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nao/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nao/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-nao/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npgo/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npgo/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npgo/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npgo/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npo/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npo/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npo/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-npo/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pdo/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pna/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pna/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pna/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-pna/cmip7/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-sam/cmip6/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-sam/cmip6/regression/diagnostic.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-sam/cmip7/manifest.json
  • packages/climate-ref-pmp/tests/test-data/extratropical-modes-of-variability-sam/cmip7/regression/diagnostic.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/climate-ref-pmp/src/climate_ref_pmp/init.py
  • changelog/901.fix.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

"osAccess": false,
"packages": {
"PMP": "3.9.2",
"PMP": "4.2.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🤖 get_repo_knowledge executed:

get_repo_knowledge Climate-REF/climate-ref /tmp/coderabbit-repo-knowledge/climate-ref-climate-ref-2aca5c04/learnings

Length of output: 4627


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- changed files and focused diff ---'
git diff --stat -- packages/climate-ref-pmp
git diff -- packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/output.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/output.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/output.json

printf '%s\n' '--- NumPy and PMP version references in tracked package/config files ---'
rg -n -i --glob '!**/node_modules/**' --glob '!**/dist/**' \
  'numpy|NumPy|PMP' packages/climate-ref-pmp .github pyproject.toml setup.cfg setup.py tox.ini 2>/dev/null || true

printf '%s\n' '--- focused provenance blocks ---'
for f in \
  packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/output.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/output.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/output.json
do
  echo "--- $f"
  sed -n '55,70p;200,214p;266,280p' "$f" 2>/dev/null || true
done

Repository: Climate-REF/climate-ref

Length of output: 50380


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- changed paths ---'
git diff --name-only

printf '%s\n' '--- focused fixture diff ---'
git diff --unified=3 -- \
  packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/output.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/output.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/output.json

printf '%s\n' '--- changed NumPy references ---'
git diff --unified=0 -- . \
  ':(exclude)packages/climate-ref-pmp/tests/unit' \
  ':(exclude)packages/climate-ref-pmp/tests/test-data' |
  rg -n -i -C 2 'numpy|NumPy|2\.2\.6|2\.0\.2' || true

printf '%s\n' '--- tracked configuration references ---'
rg -n -i --glob '*.toml' --glob '*.yaml' --glob '*.yml' --glob '*.lock' --glob '*.cfg' \
  --glob '!packages/climate-ref-pmp/tests/**' \
  'numpy|NumPy|2\.2\.6|2\.0\.2' . || true

printf '%s\n' '--- exact fixture provenance values ---'
python3 - <<'PY'
import json
from pathlib import Path

files = [
    "packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/diagnostic.json",
    "packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/output.json",
    "packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/diagnostic.json",
    "packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/output.json",
    "packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/diagnostic.json",
    "packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/output.json",
]
for name in files:
    data = json.loads(Path(name).read_text())
    found = []
    def walk(value, path="$"):
        if isinstance(value, dict):
            for key, child in value.items():
                if key.lower() in {"numpy", "numpy_version"}:
                    found.append((f"{path}.{key}", child))
                walk(child, f"{path}.{key}")
        elif isinstance(value, list):
            for i, child in enumerate(value):
                walk(child, f"{path}[{i}]")
    walk(data)
    print(name, found)
PY

Repository: Climate-REF/climate-ref

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- fixture provenance values ---'
python3 - <<'PY'
import json
from pathlib import Path

files = [
    "packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/diagnostic.json",
    "packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/output.json",
    "packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/diagnostic.json",
    "packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/output.json",
    "packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/diagnostic.json",
    "packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/output.json",
]
for name in files:
    data = json.loads(Path(name).read_text())
    matches = []
    def walk(value, path="$"):
        if isinstance(value, dict):
            for key, child in value.items():
                if "numpy" in key.lower():
                    matches.append((f"{path}.{key}", child))
                walk(child, f"{path}.{key}")
        elif isinstance(value, list):
            for index, child in enumerate(value):
                walk(child, f"{path}[{index}]")
    walk(data)
    print(name)
    for item in matches:
        print(" ", item)
PY

printf '%s\n' '--- environment pin ---'
cat -n packages/climate-ref-pmp/src/climate_ref_pmp/requirements/environment.yml

printf '%s\n' '--- locked NumPy package entries ---'
sed -n '6908,6960p' packages/climate-ref-pmp/src/climate_ref_pmp/requirements/conda-lock.yml

printf '%s\n' '--- provenance context ---'
for f in \
  packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/output.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/output.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/diagnostic.json \
  packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/output.json
do
  echo "--- $f"
  rg -n -C 3 '"PMP"|"numpy"|"NumPy"' "$f"
done

Repository: Climate-REF/climate-ref

Length of output: 5897


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- provenance generation and regression contract ---'
rg -n -i -C 3 \
  'PROVENANCE|provenance|packages\.numpy|numpy.*version|version.*numpy' \
  packages/climate-ref-pmp/src packages/climate-ref-pmp/tests \
  -g '*.py' -g '*.json' -g '*.yml' -g '*.yaml' |
  head -n 240

Repository: Climate-REF/climate-ref

Length of output: 28260


Align regression provenance with NumPy 2.2.6.

The PMP lock resolves NumPy 2.2.6, but all six listed fixtures record 2.0.2. Regenerate the fixtures or update their provenance values.

📍 Affects 6 files
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/diagnostic.json#L63-L63 (this comment)
  • packages/climate-ref-pmp/tests/test-data/enso_proc/cmip7/regression/output.json#L208-L208
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/diagnostic.json#L65-L65
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip6/regression/output.json#L274-L274
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/diagnostic.json#L65-L65
  • packages/climate-ref-pmp/tests/test-data/enso_tel/cmip7/regression/output.json#L274-L274

@lewisjared lewisjared changed the title Move the PMP provider to pcmdi_metrics 4.2.0 with a chunked variability-modes SVD Install pcmdi_metrics from a fork of 4.2.0 with a chunked variability-modes SVD Sep 3, 2026
@lewisjared

lewisjared commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Second mint failed, holding the conda pin at 3.9.2

Mint run 33730826484 bumped the conda environment to pcmdi_metrics 4.2.0, which pulls enso_metrics 2.0.0. 20 cases minted, enso_proc/cmip6 and enso_proc/cmip7 failed, and the run exited non-zero so nothing was committed.

enso_metrics 2.0.0 is a full migration off the retired CDAT stack onto xarray (CLIVAR-PRP/ENSO_metrics#95). Its new compat shim raises inside EnsoFbSstTaux.

File "EnsoMetrics/EnsoUvcdatToolsLib.py", line 5260, in get_year_by_year
    tmp = MV2concatenate((tmp, zeros))
File "EnsoMetrics/XarrayCompat.py", line 413, in _validate_axes_shape
    raise ValueError(
ValueError: CDATVariable(): axis 0 (time) length 38 does not match data shape 39

The metric then goes missing from the output bundle, so enso_driver.py:248 fails with a secondary KeyError: 'units'.

enso_metrics cannot be held back on its own, because pcmdi_metrics 4.2.0 requires >=2.0.0. So the conda pin reverts to 3.9.2 and the fork still installs 4.2.0 over the top with --no-deps. The baselines on this branch are from that run and are unaffected.

Tracked in #906, along with hardening enso_driver.py

…es SVD

The fork tracks upstream 4.2.0 and chunks the SVD in the variability modes analysis.
This cuts the runtime of the extratropical modes of variability diagnostics by roughly 40x.
It goes on with --no-deps over the 3.9.2 conda pin, which cannot move until #906 is resolved.
The chunked SVD in the forked pcmdi_metrics changes the variability modes
results, so every PMP baseline has to be re-minted. Bumping all three
diagnostics together keeps their versions moving in step.
PMP computes 12 monthly values per statistic in `CalendarMonths`, which the
transform step dropped on the way to the scalar bundle. This left `series.json`
empty for every annual cycle case.

- Extracts one 12 point series per region and statistic, indexed by month number.
- Adds a `level` dimension for the 3D pressure-level variables.
- Gives the series the same identifying dimensions as the scalars.
- Bumps the diagnostic version to 7 and re-mints the four baselines from replay.

The native artefacts are unchanged, so the mint reused the stored blobs.
* origin/main:
  refactor: share one transport between the native and report stores
  test: cover the report store's error paths
  fix: keep an unexpected key from tracebacking mid-upload
  refactor: tidy the report upload after review
  fix: name the reports bucket ref-baselines-reports
  fix: report an absent credential instead of a traceback
  fix: address the review of the report upload
  feat: publish the baseline diff report and write the PR comment
  ci: post baseline diff reports from a dedicated workflow
  fix: measure netcdf differences without losing precision or missingness
  feat: emphasise the netcdf values that actually moved
  feat: show the whole netcdf header, with a side by side view
  chore: rename the changelog fragment to the PR number
  refactor: tighten the netcdf analysis after the cleanup reviews
  feat: add netcdf stats to the baseline diff report
  chore: add a changelog fragment for the mypy 2 bump
  chore(deps): raise the mypy requirement to match the lockfile
  chore(deps): bump mistune from 3.3.0 to 3.3.3
  chore(deps): update dependency mypy to v2
@lewisjared
lewisjared deployed to baseline-reports September 4, 2026 03:43 — with GitHub Actions Active
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Regression baseline diff

22 test case(s) changed against origin/main. Full report

case versions image text netcdf other
pmp/annual-cycle/cmip6-pr v4 -> v5 ~10 ~4 none none view
pmp/annual-cycle/cmip6-ta v1 -> v2 ~10 ~5 none none view
pmp/annual-cycle/cmip6-ts v4 -> v5 ~5 ~4 none none view
pmp/annual-cycle/cmip7-ts v4 -> v5 ~5 ~4 none none view
pmp/enso_proc/cmip6 v3 -> v4 none ~3 ~4 none view
pmp/enso_proc/cmip7 v3 -> v4 none ~3 ~2 none view
pmp/enso_tel/cmip6 v3 -> v4 none ~3 ~4 none view
pmp/enso_tel/cmip7 v3 -> v4 none ~3 ~3 none view
pmp/extratropical-modes-of-variability-nam/cmip6 v4 -> v5 none ~2 ~12 none view
pmp/extratropical-modes-of-variability-nam/cmip7 v4 -> v5 none ~2 ~12 none view
pmp/extratropical-modes-of-variability-nao/cmip6 v4 -> v5 none ~2 ~12 none view
pmp/extratropical-modes-of-variability-nao/cmip7 v4 -> v5 none ~2 ~12 none view
pmp/extratropical-modes-of-variability-npgo/cmip6 v3 -> v4 ~6 ~2 ~4 none view
pmp/extratropical-modes-of-variability-npgo/cmip7 v3 -> v4 ~6 ~2 ~4 none view
pmp/extratropical-modes-of-variability-npo/cmip6 v4 -> v5 none ~2 ~16 none view
pmp/extratropical-modes-of-variability-npo/cmip7 v4 -> v5 none ~2 ~16 none view
pmp/extratropical-modes-of-variability-pdo/cmip6 v3 -> v4 ~5 ~2 ~3 none view
pmp/extratropical-modes-of-variability-pdo/cmip7 v3 -> v4 ~5 ~2 ~3 none view
pmp/extratropical-modes-of-variability-pna/cmip6 v4 -> v5 none ~2 ~12 none view
pmp/extratropical-modes-of-variability-pna/cmip7 v4 -> v5 none ~2 ~12 none view
pmp/extratropical-modes-of-variability-sam/cmip6 v4 -> v5 ~16 ~2 ~12 none view
pmp/extratropical-modes-of-variability-sam/cmip7 v4 -> v5 ~16 ~2 ~12 none view

@lewisjared
lewisjared deployed to baseline-reports September 4, 2026 03:46 — with GitHub Actions Active
@lewisjared

Copy link
Copy Markdown
Contributor Author

@lee1043 Can you take a look at the diffs in the comment above?

There are more differences in the values than I would have expected, but mostly small. The ta annual cycle @ 850 HPa did have some larger changes.

https://reports.baselines.climate-ref.org/901/23f40bd0472e/pmp/annual-cycle/cmip6-ta/index.html

@lee1043

lee1043 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@lewisjared thanks for bringing this to my attention and thanks for implementing updated PMP version into REF. It is interesting that the chance is in the annual cycle ta-850 correlation value, while for the other fields correlation remained unchanged. Let me take a look into it and get back to you soon.

@lee1043

lee1043 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@lewisjared my initial guess is it might be related to the change in newer numpy regarding how it handles NaN values -- as only 850 hPa field correlation calculation has been substantially changed. I will continue investigating..

@lee1043

lee1043 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Hi @lewisjared ,

We (PMP team) have updated PMP to v4.2.1 that now includes clarification for this #901 (comment), which was followed up in this PCMDI/pcmdi_metrics#1426. In summary, change in the correlation of ta-850 is resulted from "corrected" calculation for correlation when there are NaN value in the field, so I confirm that was expected change. We updated the format to display up to three decimal places, fixing an issue where values like 1.00 or -1.00 were previously rounded to two decimal places.

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