Phase 3: flip recent/forecast leg off Open-Meteo (NASA past + MET Norway forward) #1

Closed
admin_emi wants to merge 1 commit from feature/metno-recent-flip into feature/era5-seed
Owner

Ports Phase 3 of the Open-Meteo migration into the monorepo. Stacked on feature/era5-seed (which carries Phases 0-2b); merge that stack first, then this.

Adapted to the monorepo's newer climate.py (which has the _forecast_cooldown_until rate-limit hardening that landed after the original split branches) — this is not a blind copy of the split-repo diff.

What changes

  • _fetch_recent_forecast (new primary): recent observed window from a NASA POWER range (measured, reusing the range fetch from the history flip) + forward days from MET Norway, merged by date. Meteostat fills gusts — measured for observed days, estimated from wind for forecast days.
  • Open-Meteo forecast demoted to fallback (_fetch_recent_forecast_om), still gated by the existing _forecast_cooldown_until cooldown, then a stale cache.
  • MET Norway /complete -> /compact; forecast bundle TTL 1h -> 4h.

Verified in the monorepo: cd backend && make test -> 365 passed, 7 skipped. (Also re-ran the base feature/era5-seed: 364 passed, confirming Phases 0-2b actually pass — they were flagged unverified in CUTOVER-NOTES.) Adapted the two recent/forecast tests and the forecast_cooldown_skips_* test to the new source order; test_forecast_429_sets_its_own_cooldown still passes unchanged.

Only feature/drift-check (Phase 4) remains to complete the port.

Ports Phase 3 of the Open-Meteo migration into the monorepo. **Stacked on `feature/era5-seed`** (which carries Phases 0-2b); merge that stack first, then this. Adapted to the monorepo's newer `climate.py` (which has the `_forecast_cooldown_until` rate-limit hardening that landed after the original split branches) — this is not a blind copy of the split-repo diff. **What changes** - `_fetch_recent_forecast` (new primary): recent observed window from a NASA POWER range (measured, reusing the range fetch from the history flip) + forward days from MET Norway, merged by date. Meteostat fills gusts — measured for observed days, estimated from wind for forecast days. - Open-Meteo forecast demoted to fallback (`_fetch_recent_forecast_om`), still gated by the existing `_forecast_cooldown_until` cooldown, then a stale cache. - MET Norway `/complete` -> `/compact`; forecast bundle TTL `1h -> 4h`. **Verified in the monorepo**: `cd backend && make test` -> **365 passed, 7 skipped**. (Also re-ran the base `feature/era5-seed`: 364 passed, confirming Phases 0-2b actually pass — they were flagged unverified in CUTOVER-NOTES.) Adapted the two recent/forecast tests and the `forecast_cooldown_skips_*` test to the new source order; `test_forecast_429_sets_its_own_cooldown` still passes unchanged. Only `feature/drift-check` (Phase 4) remains to complete the port.
admin_emi added 1 commit 2026-07-23 13:32:56 +00:00
Flip recent/forecast leg off Open-Meteo (NASA past + MET Norway forward)
All checks were successful
secrets-guard / encrypted (pull_request) Successful in 7s
5569bcbc0a
The recent-observations + forward-forecast bundle is now built without Open-Meteo:
the recent observed window comes from a NASA POWER range (measured, via the range
fetch added for the history flip) and the forward days from MET Norway, merged by
date. Meteostat fills the gusts neither source carries — measured for the observed
days, estimated from wind for the forecast days.

Open-Meteo's forecast API is demoted to the fallback, still gated by its existing
_forecast_cooldown_until rate-limit cooldown; then a stale cache. MET Norway
switched to /compact (same fields, smaller payload) and the bundle TTL relaxed
1h -> 4h. NASA's near-real-time lag leaves a 1-2 day recent-edge gap that grades
as missing, bracketed by history behind and forecast ahead.

Tests updated to the new source order (NASA+MET merge, Open-Meteo fallback, and
the forecast cooldown now gating that fallback); deletion of Open-Meteo is not
done — it stays as the dormant fallback.
admin_emi closed this pull request 2026-07-23 16:14:28 +00:00
All checks were successful
secrets-guard / encrypted (pull_request) Successful in 7s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Jinemi/thermograph#1
No description provided.