Skip to content

feat: add temp eclipse adjustment logic - #363

Merged
braddf merged 1 commit into
mainfrom
feat/eclipse-adjustments
Aug 10, 2026
Merged

feat: add temp eclipse adjustment logic#363
braddf merged 1 commit into
mainfrom
feat/eclipse-adjustments

Conversation

@braddf

@braddf braddf commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

Apply a manual multiplicative adjustment to national solar forecasts for the partial solar eclipse on the evening of 12 August 2026 (~91% UK, ~88% NL, roughly 17:30–19:30 UTC).

ECMWF include the eclipse in their irradiance, but PVNet has never seen one in training and ignores it — a test run showed no kink over the eclipse window — so every model we serve over-forecasts through it. Same problem and same fix as 29 March 2025 (openclimatefix-archives/uk-pv-national-gsp-api#404), extended to NL and v1.

Multipliers come from James' and Sukh's tables (GB half-hourly, NL quarter-hourly) and live in one new module, internal/eclipse.py.

Scope

  • National only — GSP and province forecasts are untouched, as in 2025.
  • Forecasts only — PV Live / NED NL report the real dip, so generation is served as-is.
  • All natonal models, since none of them reflect the eclipse.
  • v0 (/national/forecast, /gsp/0/forecast, live paths of /gsp/forecast/all/) and v1 (/regions/{id}/forecast, /forecasts/snapshot) for GB and NL.

/forecasts/period and the pre-warmed caches need no changes: the period endpoint rejects region_type=national, warm_all_v1_caches skips NATION, and the v0 /forecast/all/ warm already excludes gsp 0.

Testing on an ordinary day: ECLIPSE_DATE=2026-08-10 uv run quartz-api moves the tables to that date. It's a plain env var read with a hardcoded default — no config or Terraform changes — so leave it unset in deployed environments.

Temporary. Once the stored values are corrected after the event, set ECLIPSE_ENABLED = False, then delete the module and its call sites. Tracked in openclimatefix/client-private#581.

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@braddf
braddf requested a review from devsjc August 10, 2026 17:27
@braddf braddf self-assigned this Aug 10, 2026
@braddf
braddf merged commit fcfcb95 into main Aug 10, 2026
6 checks passed
@braddf
braddf deleted the feat/eclipse-adjustments branch August 10, 2026 18:08
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