Skip to content

Fix accuracy in calibration of solar#3607

Merged
springfall2008 merged 6 commits intomainfrom
fix5
Mar 20, 2026
Merged

Fix accuracy in calibration of solar#3607
springfall2008 merged 6 commits intomainfrom
fix5

Conversation

@springfall2008
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 20, 2026 19:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Predbat’s solar PV forecast calibration to improve numerical accuracy by refining how historical PV/forecast data is sampled and how scaling factors are applied across future forecast days, and adds a synthetic regression test to validate key calibration outputs.

Changes:

  • Update SolarAPI.pv_calibration() to use a 7-day history window (fetching 8 days for data availability) and compute worst/best scaling relative to an average-day scaling factor.
  • Add per-forecast-day scaling compensation so future-day totals remain consistent after applying per-slot adjustments.
  • Add a new synthetic-value calibration test case and bump Predbat version to v8.34.7.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/predbat/solcast.py Adjusts PV calibration algorithm (history window, average/worst/best scaling logic, and per-day scaling correction).
apps/predbat/tests/test_solcast.py Updates existing calibration tests for the new signature and adds a synthetic regression test covering key numeric expectations.
apps/predbat/predbat.py Bumps version from v8.34.6 to v8.34.7.

@springfall2008 springfall2008 merged commit f774d2f into main Mar 20, 2026
1 check passed
@springfall2008 springfall2008 deleted the fix5 branch March 20, 2026 19:26
@springfall2008 springfall2008 restored the fix5 branch March 20, 2026 19:37
@springfall2008 springfall2008 deleted the fix5 branch March 21, 2026 13:27
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