Skip to content

Separate obs4REF reference data from published obs4MIPs - #82

Open
lewisjared wants to merge 6 commits into
mainfrom
obs4mips-labelling
Open

Separate obs4REF reference data from published obs4MIPs#82
lewisjared wants to merge 6 commits into
mainfrom
obs4mips-labelling

Conversation

@lewisjared

@lewisjared lewisjared commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Reworks the diagnostic reference dataset metadata so it matches the datasets the REF providers actually select, and separates published obs4MIPs data from our own obs4REF data. A dataset required as obs4mips but supplied from obs4REF now reads obs4ref.HadISST-1-1, and a new source_type field carries the same distinction in structured form for API consumers.

Worth a close look:

  • The source ids in esmvaltool.yaml, ilamb.yaml and pmp.yaml were previously a mix of guesses. They are now labelled from the data requirements, so most of the diff is relabelling rather than new content.
  • Adds the five ozone diagnostics, and drops pmp/enso_perf and the AMO mode, which the providers no longer register. Anything linking to those slugs will 404.
  • Fixes the ILAMB emp-gleamgpcp2.3 key, which never matched the diagnostic slug.
  • source_type duplicates the slug prefix, and only a test keeps the two in sync. Deduping it, and merging it with the source_type already used elsewhere in the API, is follow-up work.

The second commit is unrelated tooling. The Biome pre-commit hooks passed staged filenames to bash -lc "...", so they became positional arguments to bash and never reached Biome. Biome silently checked the whole frontend/ tree instead, including frontend/public/, which pre-commit itself excludes. That made the lint hook fail on every commit regardless of what changed. The hooks now run the binaries pinned in frontend/package.json rather than whatever npx --yes resolves from the registry.

Summary by CodeRabbit

  • New Features

    • Diagnostic pages now show resource usage, including wall time, CPU time and peak memory when available.
    • Added ozone diagnostic reference metadata for several C3S GTO-ECV products.
    • Reference datasets now display clearer provider and provenance information.
  • Improvements

    • Standardised reference dataset naming and source details across ESMValTool, ILAMB and PMP diagnostics.
    • Corrected ILAMB and PMP dataset identifiers and diagnostic naming.
  • Removed

    • Removed the PMP ENSO performance and extratropical AMO diagnostics.

@netlify

netlify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Preview for climate-ref ready!

Name Link
🔨 Latest commit d0d8d56
🔍 Latest deploy log https://app.netlify.com/projects/climate-ref/deploys/6a97fa4f9848e30009e2f8c1
😎 Deploy Preview https://deploy-preview-82--climate-ref.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Sep 2, 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: Team

Run ID: 8a761555-3bac-4c90-af58-0cca93d50f9b

📥 Commits

Reviewing files that changed from the base of the PR and between 430c303 and d0d8d56.

📒 Files selected for processing (8)
  • backend/src/ref_backend/core/diagnostic_metadata.py
  • backend/static/diagnostics/esmvaltool.yaml
  • backend/static/diagnostics/ilamb.yaml
  • backend/static/diagnostics/pmp.yaml
  • backend/tests/test_core/test_diagnostic_metadata.py
  • changelog/82.improvement.md
  • frontend/src/client/types.gen.ts
  • frontend/src/routes/_app/diagnostics.$providerSlug.$diagnosticSlug/route.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • changelog/82.improvement.md

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


📝 Walkthrough

Walkthrough

The change adds structured reference dataset source metadata, updates ESMValTool, ILAMB, and PMP diagnostic records, exposes execution resource usage in frontend types and views, and updates frontend pre-commit tooling.

Changes

Reference dataset metadata

Layer / File(s) Summary
Dataset source contract
backend/src/ref_backend/core/diagnostic_metadata.py
Adds the ReferenceDatasetSourceType literal and optional source_type field. Documents supplier-prefixed slugs.
Diagnostic metadata updates
backend/static/diagnostics/esmvaltool.yaml, backend/static/diagnostics/ilamb.yaml, backend/static/diagnostics/pmp.yaml, changelog/82.improvement.md
Updates dataset sources, slugs, descriptions, ozone diagnostics, and removed diagnostic entries.
Metadata validation
backend/tests/test_core/test_diagnostic_metadata.py
Tests source parsing, required source declarations, and slug-prefix consistency.
Frontend diagnostic reporting
frontend/src/client/types.gen.ts, frontend/src/routes/_app/diagnostics.$providerSlug.$diagnosticSlug/route.tsx
Adds execution resource fields and source metadata to generated types. Renders resource usage and revised dataset provenance details.

Frontend tooling

Layer / File(s) Summary
Pinned frontend checks
.pre-commit-config.yaml, frontend/biome.json, changelog/82.trivial.md
Combines Biome hooks, uses locally pinned Biome and TypeScript binaries, scopes TypeScript checks to frontend/, and excludes public from Biome processing.

Merge Risk: 🟡 Moderate · up to d0d8d

The PR changes diagnostic provenance labels and exposes aggregate execution-resource data. Merge readiness is currently moderate because the documentation/UI and validation fixture still disagree with the new source-label contract, and visibility of resource telemetry needs explicit owner confirmation.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (4 skipped: 4 u…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: separating pre-release obs4REF reference data from published obs4MIPs data.
Full details: Docstring Coverage

Explanation

Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (4 skipped: 4 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch obs4mips-labelling

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 2, 2026 09:24

@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: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 8f8567be-fa1a-43b5-9e24-6bc05e7229a4

📥 Commits

Reviewing files that changed from the base of the PR and between 162604c and 430c303.

📒 Files selected for processing (13)
  • .pre-commit-config.yaml
  • backend/src/ref_backend/core/diagnostic_metadata.py
  • backend/static/diagnostics/esmvaltool.yaml
  • backend/static/diagnostics/ilamb.yaml
  • backend/static/diagnostics/pmp.yaml
  • backend/tests/test_core/test_diagnostic_metadata.py
  • changelog/82.improvement.md
  • changelog/82.trivial.md
  • frontend/biome.json
  • frontend/src/client/schemas.gen.ts
  • frontend/src/client/types.gen.ts
  • frontend/src/components/diagnostics/diagnosticCard.tsx
  • frontend/src/routes/_app/diagnostics.$providerSlug.$diagnosticSlug/route.tsx

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

Comment thread .pre-commit-config.yaml
Comment on lines +79 to +80
files: ^frontend/.*\.(ts|tsx|js|jsx|json|jsonc|md|css)$
pass_filenames: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Expect no unsupported files, or an explicit unknown-file policy.
fd --hidden --type f frontend | rg -n '\.(md|ya?ml|scss)$' || true

Repository: Climate-REF/ref-app

Length of output: 157


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- .pre-commit-config.yaml ---'
sed -n '60,95p' .pre-commit-config.yaml

printf '%s\n' '--- frontend/biome.json ---'
cat frontend/biome.json

printf '%s\n' '--- frontend package scripts and Biome version ---'
if [ -f frontend/package.json ]; then
  sed -n '1,180p' frontend/package.json
fi

printf '%s\n' '--- frontend files with extensions relevant to Biome discovery ---'
fd --hidden --type f frontend | sort | rg '\.(md|ya?ml|scss|ts|tsx|js|jsx|json|jsonc|css)$' || true

Repository: Climate-REF/ref-app

Length of output: 5502


🌐 Web query:

Biome 2.2.4 CLI files ignoreUnknown unsupported Markdown files check documentation

💡 Result:

In Biome, the files.ignoreUnknown configuration option is used to control how the CLI handles files with extensions that Biome does not recognize [1][2]. By setting ignoreUnknown to true in your biome.json configuration file, you tell Biome to suppress diagnostic errors when it encounters unsupported file types [1]. If you are encountering errors when running Biome on unsupported files (such as Markdown files, if they are not explicitly supported or handled by your configuration), you can resolve this in the following ways: 1. Configuration File: Add the following to your biome.json file [1]: { "files": { "ignoreUnknown": true } } 2. CLI Flag: You can also use the --files-ignore-unknown flag directly in your terminal command to achieve the same effect for a single execution [3][4]: biome check --files-ignore-unknown=true. If you continue to see errors such as "No files were processed in the specified paths," this is often expected behavior if Biome is configured to only look at specific files or if the input paths provided are entirely ignored [5][4]. In such cases, you may also want to use the --no-errors-on-unmatched flag, which prevents the CLI from exiting with an error code if no files are matched by your provided patterns [5]. For more details on managing file inclusion and exclusion, you can refer to the official Biome configuration documentation [1][6].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- all frontend files ---'
fd --hidden --type f frontend | sort | head -200

printf '%s\n' '--- tracked frontend files ---'
git ls-files frontend | sort | head -200

printf '%s\n' '--- lockfile Biome resolution ---'
rg -n -m 8 '"`@biomejs/biome`"|node_modules/@biomejs/biome|biome@' frontend/package-lock.json frontend/yarn.lock frontend/pnpm-lock.yaml frontend/bun.lockb 2>/dev/null || true

Repository: Climate-REF/ref-app

Length of output: 9834


Prevent the Biome hook from scanning unsupported files.

biome check --write scans the whole frontend directory. frontend/biome.json includes unknown files and sets files.ignoreUnknown to false. Files such as frontend/README.md can therefore make the hook fail when a matching file triggers it. Remove unsupported extensions from the hook trigger or set files.ignoreUnknown to true.

Source: MCP tools

Comment on lines +5 to +7
# `slug` is `<supplier>.<source_id>`, and `source` says the same thing in a structured field.
# The prefix names who supplies the data, not the source type the requirement asks for, so a
# dataset required as `obs4mips` but served pre-release reads `obs4ref.HadISST-1-1`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep supplier identity and provenance separate.

A slug encodes the supplier, but source can be "recipe". For example, esmvaltool.GPCP-V2.3 has source: "recipe". The current wording states that these values mean the same thing, so the tooltip gives incorrect provenance for recipe-backed datasets.

  • backend/static/diagnostics/esmvaltool.yaml#L5-L7: State that slug identifies the supplier and that source records separate provenance.
  • frontend/src/routes/_app/diagnostics.$providerSlug.$diagnosticSlug/route.tsx#L232-L234: Do not describe the slug as the data source. Display ref.source when present, or describe the slug as the supplier identifier.
📍 Affects 2 files
  • backend/static/diagnostics/esmvaltool.yaml#L5-L7 (this comment)
  • frontend/src/routes/_app/diagnostics.$providerSlug.$diagnosticSlug/route.tsx#L232-L234

yaml_content = {
"with/source": {
"reference_datasets": [
{"slug": "obs4mips.HadISST-1-1", "type": "primary", "source": "obs4ref"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use a valid slug in the source parsing fixture.

Line 299 sets source: "obs4ref" but uses the obs4mips slug prefix. The new contract requires the supplier prefix and source to agree. Change the slug to obs4ref.HadISST-1-1, or add a separate test that asserts mismatches are rejected.

Reworks the diagnostic reference dataset metadata so it matches the datasets the
providers actually select, and so a reader can tell published data from our
pre-release data.

- Names each dataset by who supplies it, so a dataset required as `obs4mips` but
  served ahead of publication now reads `obs4ref.HadISST-1-1`.
- Adds a `source` field carrying the same thing in a structured form, with a test
  that keeps it in step with the name.
- Corrects the source ids against the providers' data requirements, so ILAMB and
  PMP datasets are labelled from the providers rather than from a mix of guesses.
- Adds the five ozone diagnostics, and drops `pmp/enso_perf` and the AMO mode,
  which the providers no longer register.
- Fixes the ILAMB `emp-gleamgpcp2.3` key, which never matched the diagnostic slug.

The reference dataset cards now float the primary/secondary badge to the top right,
because the dataset itself matters more than its role.
The Biome hooks passed staged filenames to `bash -lc "..."`, so they landed as
positional arguments to bash rather than as arguments to Biome. Biome never saw
them and checked the whole `frontend/` tree instead. That pulled in
`frontend/public/favicon.svg`, which pre-commit itself excludes, so `biome-lint`
failed on every commit regardless of what changed.

- Collapses the two hooks into one `biome-check`, because `check --write` already
  covers format and lint.
- Sets `pass_filenames: false`, which is what the hook was doing anyway.
- Runs the pinned `frontend/node_modules/.bin` binaries instead of `npx --yes`,
  so Biome and tsc match the versions in `package.json` rather than whatever the
  registry serves.
- Ignores `public/` in `biome.json` to match the pre-commit exclude, and bumps
  the schema to the installed 2.5.11.
Uses the field's full name, which lines it up with the `source_type` already used
elsewhere in the API so the two can be merged later.
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.

1 participant