Skip to content

Add a staging mode and scope values to the selected MIP era - #87

Merged
lewisjared merged 1 commit into
mainfrom
staging-mode
Sep 2, 2026
Merged

Add a staging mode and scope values to the selected MIP era#87
lewisjared merged 1 commit into
mainfrom
staging-mode

Conversation

@lewisjared

Copy link
Copy Markdown
Contributor

Adds a staging mode, and fixes the MIP era selection so it reaches the values query rather than only the charts drawn from it.

Staging mode

  • /api/v1/utils/about now reports environment, taken from the existing ENVIRONMENT setting.
  • A staging deployment carries a banner at the top of every page naming it as one.
  • The sample-size floor is dropped there, so a chart is drawn even when only one or two models have results. The sparse-sample warning still shows.
  • Turn it on by setting ENVIRONMENT=staging.

MIP era filtering

The era picker only split charts in the browser, so the backend never saw it.

  • Outlier detection pooled CMIP6 and CMIP7 into one IQR group, so the era a reader had selected did not decide which values were flagged.
  • Pagination counted both eras, so a page held fewer rows than the limit asked for.
  • /values now takes mip_era and scopes to that era's executions, plus any execution no era can be settled for, so unattributed values are not lost.
  • The explorer charts pass the selected era, and the scalar and series value tabs carry the era selector too, so a table shows one era at a time.

Sparse-sample warning

Drops the model-family grouping. The warning now counts distinct source_id values, so a chart drawn from fewer than ten models is flagged whatever centres they came from. The note on the era bar about the two eras not being comparable is gone as well.

Checked against the fixture data: the banner renders, single-model charts plot on staging, and the scalar tab shows seven CMIP6 rows with nothing under CMIP7.

Adds a staging mode, driven by the `ENVIRONMENT` setting that `/api/v1/utils/about` now reports.
A staging deployment carries a banner naming it as one, and drops the sample-size floor so a chart is
drawn even when only one or two models have results.

The MIP era a reader selects now reaches the values query rather than only the charts drawn from it.
Outlier detection pooled CMIP6 and CMIP7 into one IQR group, so the selected era did not decide which
values were flagged, and pagination counted both eras. The scalar and series value tabs carry the era
selector too, so a table shows one era at a time.

Also drops the model-family grouping behind the sparse-sample warning. The warning now counts
distinct `source_id` values.
@netlify

netlify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Preview for climate-ref ready!

Name Link
🔨 Latest commit aeab504
🔍 Latest deploy log https://app.netlify.com/projects/climate-ref/deploys/6a981d59aaafd50008604758
😎 Deploy Preview https://deploy-preview-87--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

Warning

Review limit reached

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: a453d545-7d25-46ed-818c-9e45bd1591e4

📥 Commits

Reviewing files that changed from the base of the PR and between fe8d8d5 and aeab504.

📒 Files selected for processing (28)
  • backend/src/ref_backend/api/routes/diagnostics.py
  • backend/src/ref_backend/api/routes/utils.py
  • backend/src/ref_backend/core/mip_eras.py
  • backend/src/ref_backend/models/about.py
  • backend/tests/test_api/test_routes/test_diagnostics.py
  • backend/tests/test_api/test_routes/test_utils.py
  • changelog/87.feature.md
  • changelog/87.fix.md
  • changelog/87.improvement.md
  • frontend/src/client/@tanstack/react-query.gen.ts
  • frontend/src/client/sdk.gen.ts
  • frontend/src/client/types.gen.ts
  • frontend/src/components/app/index.ts
  • frontend/src/components/app/stagingBanner.test.tsx
  • frontend/src/components/app/stagingBanner.tsx
  • frontend/src/components/charts/mipEraBar.tsx
  • frontend/src/components/charts/mipEraSections.test.tsx
  • frontend/src/components/charts/mipEraSections.tsx
  • frontend/src/components/explorer/content/ensembleChartContent.tsx
  • frontend/src/components/explorer/content/seriesChartContent.tsx
  • frontend/src/components/explorer/content/taylorDiagramContentWrapper.tsx
  • frontend/src/hooks/useMetricValues.ts
  • frontend/src/hooks/useStagingMode.ts
  • frontend/src/lib/mipEras.test.ts
  • frontend/src/lib/mipEras.ts
  • frontend/src/routes/__root.tsx
  • frontend/src/routes/_app/diagnostics.$providerSlug.$diagnosticSlug/scalars.tsx
  • frontend/src/routes/_app/diagnostics.$providerSlug.$diagnosticSlug/series.tsx

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 merged commit 2888a52 into main Sep 2, 2026
9 checks passed
@lewisjared
lewisjared deleted the staging-mode branch September 2, 2026 13:01
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