Skip to content

Weather vs S2S scales, one-call forecast/compare API, new models (0.3.0) - #3

Merged
GISWLH merged 3 commits into
mainfrom
claude/kind-dijkstra-2jhvv9
Oct 6, 2026
Merged

GISWLH merged 3 commits into
mainfrom
claude/kind-dijkstra-2jhvv9

Conversation

@GISWLH

@GISWLH GISWLH commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Summary

Two forecast scales, one interface. Leads ≤ 15 days are weather (fields at lead hours); leads > 15 days are S2S (weekly means, week k = days 7(k-1)..7k after init).

ds  = wp.forecast("graphcast", "z500", "7d", init="2020-10-03")
cmp = wp.compare(["ifs-ext", "gefs", "cfsv2", "persistence", "climatology"], "t2m", "6w", init="2020-10-01..2020-10-29")
cmp.table(); cmp.ranking(); cmp.plot("scores.png"); cmp.plot_maps("week3.png", "t2m", 3)

Simple interface

  • wp.forecast(model, variable, lead, init=...). Lead strings: 48h, 7d, 15d, 6w, 45d, week3-4, w3, 24,48,72. Variable aliases work (precip, mslp, T2M).
  • wp.compare(...) returns a Comparison with .table(), .ranking(), .summary(), .plot() and .plot_maps().
    • init="START..END" averages over several inits: RMSE is pooled as the square root of the mean MSE, ACC is the plain mean.
  • Old keyword calls still work: lead_days=, lead_hours=, preset=, and init as the second positional argument.
  • New CLI: weatherpre forecast MODEL [VAR] [LEAD], weatherpre compare MODELS [VAR] [LEAD], weatherpre models --scale s2s [--all].
    • Breaking: the old compare --models ... command is now compare-wb2.

Model catalog and new models

  • weatherpre/catalog.py is now the single source of truth. It drives backend routing, weatherpre models, and the generated README tables (scripts/gen_model_table.py).
  • New hosted models (no GPU needed):
    • NOAA GEFSv12 ensemble mean: 0.5°, to 35 days, 2020-09-23 onwards.
    • NOAA CFSv2: 9 months, member 1.
    • ECMWF extended range ensemble mean: WeatherBench 2, 2016–2022.
    • S2S baselines: climatology and persistence.
  • Earth2Studio route rewritten:
    • Catalog entries: AIFS v2, AIFS-ENS v2, Aurora 1.5, FourCastNet 3, Atlas, U-CAST, WeatherNext 2, GenCast-mini, SFNO, FengWu, FuXi-S2S, DLESyM, ACE2.
    • Any "e2s:<ClassName>" also works.
    • Class names were checked against earth2studio 0.19.

S2S verification

  • Weekly means are scored against ERA5 weekly means, with RMSE and ACC (ACC uses the 1990–2017 weekly climatology), via WeatherBench-X.
  • Models on other grids are box-smoothed to the WeatherBench 2 1.5° grid before scoring.
  • S2S anomaly maps are added (wp.anomaly, maps.plot_s2s), plus a combined RMSE/ACC skill plot.

Project / README

  • The README is now bilingual (README.md in English, README_zh.md in Chinese), with a hero figure and real accuracy tables.
  • The long 2020-10-03 weather examples moved to docs/EXAMPLES.md.
  • Added: tests, ci.yml (ruff + pytest on 3.11 and 3.12; live-data tests are opt-in), CONTRIBUTING, CITATION.cff, CHANGELOG and issue templates.
  • pyproject now has the extras [gpu], [hf] and [dev], and the version is unified at 0.3.0.

Fixes

  • The interpreter crashed at exit ("double free") when eccodes was loaded before PROJ. Fixed by importing pyproj before cfgrib.
  • Scoring failed when there was only one lead or one week (WeatherBench-X results were over-squeezed). Fixed.
  • When the latest cycle is scored against the IFS analysis, models on other grids (e.g. GEFS) are now interpolated to the analysis grid. Any remaining scoring error is reported as skipped instead of crashing.
  • GEFS S3 requests now retry on 503 "Slow Down".

Results (real runs, in the README)

  • S2S, October 2020 (all 9 Monday/Thursday inits), t2m ACC:
    • ECMWF extended range: 0.84 in week 1, 0.41 in week 3.
    • GEFS: 0.77 in week 1, 0.42 in week 3.
    • From week 3 on, ensemble-mean RMSE is only slightly below climatology.
  • Weather, 2020-10-03, 7 days, mean rank: GraphCast 1.3, Pangu 1.8, IFS HRES 3.2, GEFS 3.8.

Test plan

  • pytest -q: 52 passed (offline)
  • WEATHERPRE_NETWORK=1 pytest -m network: 5 passed. Covers WeatherBench 2, GEFS, ifs-ext vs climatology, single lead/week scoring, and Earth2Studio Persistence on CPU.
  • ruff check weatherpre tests scripts
  • python -m compileall weatherpre scripts hf (the check workflow from main)
  • CLI models, forecast, compare run end to end. Each README example was run once. Exceptions: the aurora / e2s:FCN3 lines need a GPU or HF token, and latest AIFS was reached only through the AWS mirror (data.ecmwf.int is blocked here), where S3 throttled it.
  • Large Earth2Studio models (FCN3, AIFS v2, …) on a real GPU. This was not possible here: no GPU.
  • First GitHub Actions run of ci.yml. It installs weatherbenchX from git and may need tuning.

🤖 Generated with Claude Code

https://claude.ai/code/session_012XaUZ3NVhMrZPpC27Jw2Js


Generated by Claude Code

claude added 3 commits October 5, 2026 14:59
- Split forecasts into weather (<= 15 d, fields at lead hours) and S2S
  (> 15 d, weekly means); lead strings like "48h", "7d", "6w", "week3-4"
- wp.forecast(model, variable, lead, init) and wp.compare(...) returning
  a Comparison (table, ranking, plots, multi-init averaging); legacy
  keyword calls still work
- Model catalog drives routing, `weatherpre models` and README tables
- New hosted models: NOAA GEFSv12 ens. mean, NOAA CFSv2, ECMWF extended
  range (WB2), climatology and persistence baselines
- S2S verification vs ERA5 weekly means (RMSE, ACC) with WeatherBench-X
- Earth2Studio route rewritten (AIFS v2, Aurora 1.5, FCN3, Atlas, U-CAST,
  WeatherNext 2, FuXi-S2S, DLESyM, ACE2, any "e2s:<Class>"), tested on
  CPU with Persistence
- New CLI (forecast / compare / models --scale), tests, CI, CONTRIBUTING,
  CITATION, CHANGELOG, bilingual README
- Fix exit crash when eccodes loads before PROJ; fix single-lead scoring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012XaUZ3NVhMrZPpC27Jw2Js
- ECMWF extended range, GEFS, CFSv2, persistence and climatology scored
  for weeks 1-6 against ERA5 weekly means; tables in both READMEs
- Maps show the scores of the init they draw, not the multi-init mean

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012XaUZ3NVhMrZPpC27Jw2Js
@GISWLH
GISWLH merged commit 2996237 into main Oct 6, 2026
3 checks passed
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