Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,20 @@ repos:
files: ^backend/

# Frontend: Biome format + lint
# Both hooks use the versions pinned in frontend/package.json, not whatever npx resolves.
- repo: local
hooks:
- id: biome-format
name: Biome format (write)
entry: bash -lc "cd frontend && npx --yes @biomejs/biome check --write"
- id: biome-check
name: Biome check (write)
entry: bash -c "cd frontend && exec ./node_modules/.bin/biome check --write"
language: system
files: ^frontend/.*\.(ts|tsx|js|jsx|json|md|css)$
pass_filenames: true
- id: biome-lint
name: Biome lint
entry: bash -lc "cd frontend && npx --yes @biomejs/biome check"
language: system
files: ^frontend/.*\.(ts|tsx|js|jsx)$
pass_filenames: true
files: ^frontend/.*\.(ts|tsx|js|jsx|json|jsonc|md|css)$
pass_filenames: false
Comment on lines +79 to +80

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


# Frontend: TypeScript typecheck
- id: typescript-typecheck
name: TypeScript typecheck
entry: bash -lc "cd frontend && npx --yes tsc -b --noEmit"
entry: bash -c "cd frontend && exec ./node_modules/.bin/tsc -b --noEmit"
language: system
pass_filenames: false
files: ^frontend/
40 changes: 38 additions & 2 deletions backend/src/ref_backend/core/diagnostic_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
from loguru import logger
from pydantic import BaseModel, Field

ReferenceDatasetSourceType = Literal[
"obs4mips",
"obs4ref",
"pmp-climatology",
"esmvaltool-reference",
"ilamb",
"recipe",
]
"""
The source type of the data actually supplied for a reference dataset.

A diagnostic can require ``obs4mips`` and be served the REF's own ``obs4ref`` copy, so what is
supplied has to be recorded separately from what the requirement asks for.
"""


class ReferenceDatasetLink(BaseModel):
"""
Expand All @@ -26,10 +41,30 @@ class ReferenceDatasetLink(BaseModel):
compare model outputs against. They can be classified by their role in the analysis.
"""

slug: str = Field(..., description="Unique identifier for the dataset(e.g., 'obs4mips.CERES-EBAF.v4.2')")
slug: str = Field(
...,
description=(
"Unique identifier for the dataset, `<supplier>.<source_id>`. The prefix names who "
"supplies the data rather than the source type the requirement asks for, so a dataset "
"required as obs4mips but supplied from obs4REF reads 'obs4ref.HadISST-1-1'"
),
)
description: str | None = Field(
None, description="Description of how this dataset is used in the diagnostic"
)
source_type: ReferenceDatasetSourceType | None = Field(
None,
description=(
"The source type of the data actually supplied, which is not always the one the "
"requirement asks for:\n"
"- 'obs4mips': published on ESGF obs4MIPs\n"
"- 'obs4ref': reference data served by the REF, not yet published on obs4MIPs\n"
"- 'pmp-climatology': the PMP climatology registry\n"
"- 'esmvaltool-reference': the ESMValTool reference registry\n"
"- 'ilamb': the ILAMB registry\n"
"- 'recipe': named inside the provider's recipe rather than ingested by the REF"
),
)
type: Literal["primary", "secondary", "comparison"] = Field(
...,
description=(
Expand Down Expand Up @@ -121,7 +156,8 @@ def load_diagnostic_metadata(path: Path) -> dict[str, DiagnosticMetadata]:

pmp/annual-cycle:
reference_datasets:
- slug: "obs4mips.CERES-EBAF.v4.2"
- slug: "obs4mips.CERES-EBAF-4-2-1"
source_type: "obs4mips"
description: "CERES Energy Balanced and Filled"
type: "primary"
display_name: "Annual Cycle Analysis"
Expand Down
162 changes: 118 additions & 44 deletions backend/static/diagnostics/esmvaltool.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# ESMValTool Diagnostic Metadata
#
# Reference datasets and display metadata for ESMValTool diagnostics.
#
# `slug` is `<supplier>.<source_id>`, and `source_type` 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 supplied from obs4REF reads `obs4ref.HadISST-1-1`.

esmvaltool/cloud-radiative-effects:
reference_datasets:
- slug: "esmvaltool.CERES-EBAF"
description: "CERES Energy Balanced and Filled - TOA radiation fluxes (rlut, rlutcs, rsut, rsutcs) (planned to move to obs4MIPs)"
- slug: "obs4mips.CERES-EBAF-4-2-1"
source_type: "obs4mips"
description: "CERES Energy Balanced and Filled v4.2.1. Supplies rlut, rlutcs, rsut and rsutcs."
type: "primary"
- slug: "esmvaltool.ESACCI-CLOUD"
description: "ESA CCI Cloud properties (planned to move to obs4MIPs)"
type: "secondary"
- slug: "esmvaltool.ISCCP-FH"
description: "ISCCP cloud properties (planned to move to obs4MIPs)"
type: "secondary"
display_name: "Cloud Radiative Effects"
description: >-
Plot climatologies and zonal mean profiles of cloud radiative effects
Expand All @@ -21,11 +20,9 @@ esmvaltool/cloud-radiative-effects:

esmvaltool/cloud-scatterplots-cli-ta:
reference_datasets:
- slug: "obs4mips.ERA-5"
description: "ERA5 - Air temperature (ta)"
type: "primary"
- slug: "esmvaltool.CALIPSO-ICECLOUD"
description: "CALIPSO - Ice cloud properties (cli), baked into recipe"
source_type: "recipe"
description: "CALIPSO ice cloud properties. Supplies cli, named in the recipe."
type: "secondary"
display_name: "Cloud-Temperature Scatterplots (cli vs ta)"
description: >-
Expand All @@ -37,10 +34,12 @@ esmvaltool/cloud-scatterplots-cli-ta:
esmvaltool/cloud-scatterplots-clivi-lwcre:
reference_datasets:
- slug: "esmvaltool.CERES-EBAF"
description: "CERES Energy Balanced and Filled - Longwave radiation (rlut, rlutcs; lwcre derived), baked into recipe"
source_type: "recipe"
description: "CERES Energy Balanced and Filled. Supplies rlut and rlutcs (lwcre derived), named in the recipe."
type: "primary"
- slug: "esmvaltool.ESACCI-CLOUD"
description: "ESA CCI Cloud properties - Ice water path (clivi), baked into recipe"
source_type: "recipe"
description: "ESA CCI cloud properties. Supplies clivi, named in the recipe."
type: "secondary"
display_name: "Cloud-Radiation Scatterplots (clivi vs lwcre)"
description: "Scatterplot of ice water path (clivi) vs longwave cloud radiative effect (lwcre)."
Expand All @@ -49,25 +48,30 @@ esmvaltool/cloud-scatterplots-clivi-lwcre:
esmvaltool/cloud-scatterplots-clt-swcre:
reference_datasets:
- slug: "esmvaltool.CERES-EBAF"
description: "CERES Energy Balanced and Filled - Shortwave radiation (rsut, rsutcs; swcre derived), baked into recipe"
source_type: "recipe"
description: "CERES Energy Balanced and Filled. Supplies rsut and rsutcs (swcre derived), named in the recipe."
type: "primary"
- slug: "esmvaltool.ESACCI-CLOUD"
description: "ESA CCI Cloud properties - Total cloud fraction (clt), baked into recipe"
source_type: "recipe"
description: "ESA CCI cloud properties. Supplies clt, named in the recipe."
type: "secondary"
display_name: "Cloud-Radiation Scatterplots (clt vs swcre)"
description: "Scatterplot of total cloud fraction (clt) vs shortwave cloud radiative effect (swcre)."
tags: ["atmosphere", "clouds", "radiation"]

esmvaltool/cloud-scatterplots-clwvi-pr:
reference_datasets:
- slug: "obs4MIPs.GPCPv2.3"
description: "GPCP v2.3 - Precipitation (pr)"
- slug: "esmvaltool.GPCP-V2.3"
source_type: "recipe"
description: "GPCP v2.3. Supplies pr, named in the recipe."
type: "secondary"
- slug: "esmvaltool.ESACCI-CLOUD"
description: "ESA CCI Cloud properties (clwvi, planned to move to obs4MIPs)"
source_type: "recipe"
description: "ESA CCI cloud properties. Supplies clwvi, named in the recipe."
type: "secondary"
- slug: "esmvaltool.CERES-EBAF"
description: "CERES Energy Balanced and Filled - Radiation, baked into recipe"
source_type: "recipe"
description: "CERES Energy Balanced and Filled. Supplies the radiation fields, named in the recipe."
type: "primary"
display_name: "Cloud-Precipitation Scatterplots (clwvi vs pr)"
description: "Scatterplot of condensed water path (clwvi) vs precipitation (pr)."
Expand All @@ -76,19 +80,24 @@ esmvaltool/cloud-scatterplots-clwvi-pr:
esmvaltool/cloud-scatterplots-reference:
reference_datasets:
- slug: "obs4mips.ERA-5"
description: "ERA5 - Air temperature (ta), ingested via REF"
source_type: "obs4mips"
description: "ERA5 reanalysis. Supplies ta over 2007 to 2014."
type: "primary"
- slug: "esmvaltool.CERES-EBAF"
description: "CERES Energy Balanced and Filled - Radiation, baked into recipe"
source_type: "recipe"
description: "CERES Energy Balanced and Filled. Supplies the radiation fields, named in the recipe."
type: "primary"
- slug: "esmvaltool.CALIPSO-ICECLOUD"
description: "CALIPSO - Ice cloud properties (cli), baked into recipe"
source_type: "recipe"
description: "CALIPSO ice cloud properties. Supplies cli, named in the recipe."
type: "secondary"
- slug: "esmvaltool.ESACCI-CLOUD"
description: "ESA CCI Cloud properties (clt, clwvi, clivi), baked into recipe"
source_type: "recipe"
description: "ESA CCI cloud properties. Supplies clt, clwvi and clivi, named in the recipe."
type: "secondary"
- slug: "esmvaltool.GPCP-V2.3"
description: "GPCP v2.3 - Precipitation (pr), hardcoded in update_recipe"
source_type: "recipe"
description: "GPCP v2.3. Supplies pr, named in the recipe because it cannot be ingested (climate-ref issue 260)."
type: "secondary"
display_name: "Cloud Scatterplots for Reference dataset"
description: >-
Expand All @@ -99,10 +108,12 @@ esmvaltool/cloud-scatterplots-reference:
esmvaltool/enso-basic-climatology:
reference_datasets:
- slug: "esmvaltool.GPCP-V2.3"
description: "GPCP v2.3 - Precipitation (pr), baked into recipe"
source_type: "recipe"
description: "GPCP v2.3. Supplies pr, named in the recipe."
type: "secondary"
- slug: "esmvaltool.TROPFLUX"
description: "TROPFLUX (OBS6) - Sea surface temperature (tos) and wind stress (tauu), baked into recipe"
source_type: "recipe"
description: "TropFlux. Supplies tos and tauu, named in the recipe."
type: "secondary"
display_name: "ENSO Basic Climatology"
description: >-
Expand All @@ -113,14 +124,63 @@ esmvaltool/enso-basic-climatology:
esmvaltool/enso-characteristics:
reference_datasets:
- slug: "esmvaltool.TROPFLUX"
description: "TROPFLUX (OBS6) - Sea surface temperature (tos), hardcoded in update_recipe"
source_type: "recipe"
description: "TropFlux. Supplies tos, named in the recipe."
type: "primary"
display_name: "ENSO Characteristics"
description: >-
Calculate the ENSO CLIVAR metrics for basic ENSO characteristics,
evaluating the amplitude, frequency, and spatial structure of ENSO events.
tags: ["ocean", "enso", "variability"]

esmvaltool/ozone-annual-cycle:
reference_datasets:
- slug: "obs4mips.C3S-GTO-ECV-9-0"
source_type: "obs4mips"
description: "C3S GTO-ECV total column ozone v9.0. Supplies toz."
type: "primary"
display_name: "Ozone Annual Cycle"
description: "Plot the zonal mean total column ozone (toz) against the annual cycle."
tags: ["atmosphere", "ozone", "seasonal-cycle"]

esmvaltool/ozone-lat-time:
reference_datasets:
- slug: "obs4mips.C3S-GTO-ECV-9-0"
source_type: "obs4mips"
description: "C3S GTO-ECV total column ozone v9.0. Supplies toz."
type: "primary"
display_name: "Ozone Latitude vs Time"
description: "Plot the zonal mean total column ozone (toz) against time."
tags: ["atmosphere", "ozone", "timeseries"]

esmvaltool/ozone-nh-mar:
reference_datasets:
- slug: "obs4mips.C3S-GTO-ECV-9-0"
source_type: "obs4mips"
description: "C3S GTO-ECV total column ozone v9.0. Supplies toz."
type: "primary"
display_name: "Ozone Northern Polar Cap (March)"
description: "Plot the March Northern Hemisphere polar mean (60N to 80N) total column ozone (toz) time series."
tags: ["atmosphere", "ozone", "polar"]

esmvaltool/ozone-sh-oct:
reference_datasets:
- slug: "obs4mips.C3S-GTO-ECV-9-0"
source_type: "obs4mips"
description: "C3S GTO-ECV total column ozone v9.0. Supplies toz."
type: "primary"
display_name: "Ozone Southern Polar Cap (October)"
description: "Plot the October Southern Hemisphere polar mean (60S to 85S) total column ozone (toz) time series."
tags: ["atmosphere", "ozone", "polar"]

esmvaltool/ozone-zonal:
reference_datasets: []
display_name: "Ozone Zonal Mean Profiles"
description: >-
Plot the stratospheric zonal mean ozone (o3) profiles. No reference dataset is used yet,
because ESACCI-OZONE (SAGE-OMPS) is not on obs4MIPs.
tags: ["atmosphere", "ozone", "stratosphere"]

esmvaltool/equilibrium-climate-sensitivity:
reference_datasets: []
display_name: "Equilibrium Climate Sensitivity (ECS)"
Expand Down Expand Up @@ -161,16 +221,20 @@ esmvaltool/zero-emission-commitment:
esmvaltool/regional-historical-annual-cycle:
reference_datasets:
- slug: "obs4mips.ERA-5"
description: "ERA-5 - Sea level pressure (psl) and zonal wind (ua), ingested via REF"
source_type: "obs4mips"
description: "ERA5 reanalysis. Supplies psl and ua."
type: "primary"
- slug: "esmvaltool.HadCRUT5"
description: "HadCRUT5 v5.0.1.0-analysis - Near-surface air temperature (tas), hardcoded in recipe"
source_type: "recipe"
description: "HadCRUT5 v5.0.1.0 analysis. Supplies tas, named in the recipe."
type: "secondary"
- slug: "esmvaltool.GPCP-V2.3"
description: "GPCP v2.3 - Precipitation (pr), hardcoded in recipe (cannot be ingested, issue #260)"
source_type: "recipe"
description: "GPCP v2.3. Supplies pr, named in the recipe because it cannot be ingested (climate-ref issue 260)."
type: "secondary"
- slug: "esmvaltool.ERA5-native6"
description: "ERA5 native6 - Specific humidity (hus), not yet on obs4MIPs"
source_type: "recipe"
description: "ERA5 native6. Supplies hus, which is not on obs4MIPs."
type: "secondary"
display_name: "Regional Historical Annual Cycle"
description: >-
Expand All @@ -183,16 +247,20 @@ esmvaltool/regional-historical-annual-cycle:
esmvaltool/regional-historical-timeseries:
reference_datasets:
- slug: "obs4mips.ERA-5"
description: "ERA-5 - Sea level pressure (psl) and zonal wind (ua), ingested via REF"
source_type: "obs4mips"
description: "ERA5 reanalysis. Supplies psl and ua."
type: "primary"
- slug: "esmvaltool.HadCRUT5"
description: "HadCRUT5 v5.0.1.0-analysis - Near-surface air temperature (tas), hardcoded in recipe"
source_type: "recipe"
description: "HadCRUT5 v5.0.1.0 analysis. Supplies tas, named in the recipe."
type: "secondary"
- slug: "esmvaltool.GPCP-V2.3"
description: "GPCP v2.3 - Precipitation (pr), hardcoded in recipe (cannot be ingested, issue #260)"
source_type: "recipe"
description: "GPCP v2.3. Supplies pr, named in the recipe because it cannot be ingested (climate-ref issue 260)."
type: "secondary"
- slug: "esmvaltool.ERA5-native6"
description: "ERA5 native6 - Specific humidity (hus), not yet on obs4MIPs"
source_type: "recipe"
description: "ERA5 native6. Supplies hus, which is not on obs4MIPs."
type: "secondary"
display_name: "Regional Historical Timeseries"
description: >-
Expand All @@ -205,16 +273,20 @@ esmvaltool/regional-historical-timeseries:
esmvaltool/regional-historical-trend:
reference_datasets:
- slug: "obs4mips.ERA-5"
description: "ERA-5 - Sea level pressure (psl), near-surface air temperature (tas), and zonal wind (ua), ingested via REF"
source_type: "obs4mips"
description: "ERA5 reanalysis. Supplies psl, tas and ua."
type: "primary"
- slug: "esmvaltool.HadCRUT5"
description: "HadCRUT5 v5.0.1.0-analysis - Near-surface air temperature (tas), hardcoded in recipe"
source_type: "recipe"
description: "HadCRUT5 v5.0.1.0 analysis. Supplies tas, named in the recipe."
type: "secondary"
- slug: "esmvaltool.GPCP-V2.3"
description: "GPCP v2.3 - Precipitation (pr), hardcoded in recipe (cannot be ingested, issue #260)"
source_type: "recipe"
description: "GPCP v2.3. Supplies pr, named in the recipe because it cannot be ingested (climate-ref issue 260)."
type: "secondary"
- slug: "esmvaltool.ERA5-native6"
description: "ERA5 native6 - Specific humidity (hus) and precipitation (pr), hardcoded in recipe"
source_type: "recipe"
description: "ERA5 native6. Supplies hus and pr, named in the recipe."
type: "secondary"
display_name: "Regional Historical Trends"
description: >-
Expand All @@ -226,11 +298,13 @@ esmvaltool/regional-historical-trend:

esmvaltool/sea-ice-area-basic:
reference_datasets:
- slug: "esmvaltool.OSI-450-nh"
description: "OSI-450 v3 - Sea ice concentration (siconc), Northern Hemisphere, hardcoded in recipe"
- slug: "esmvaltool-reference.OSI-450-nh"
source_type: "esmvaltool-reference"
description: "OSI-450 v3 Northern Hemisphere. Supplies sic and areacello."
type: "primary"
- slug: "esmvaltool.OSI-450-sh"
description: "OSI-450 v3 - Sea ice concentration (siconc), Southern Hemisphere, hardcoded in recipe"
- slug: "esmvaltool-reference.OSI-450-sh"
source_type: "esmvaltool-reference"
description: "OSI-450 v3 Southern Hemisphere. Supplies sic and areacello."
type: "primary"
display_name: "Arctic and Antarctic Sea Ice Area Seasonal Cycle"
description: >-
Expand Down
Loading
Loading