fix(pvforecast): align the calibration window to the UTC slot grid

Additional fixes
PV meter energy comes from the quality-aware conversion.
Calibration rows are binned by interval start with end-stamped rows.
The fit covers only the period every PV meter covers and stays inside its lookback.
The meter resolution is judged only where every PV meter reports.
Snow feedback derives its window from the same slot window helper and shares one PV meter read per forecast with calibration.
Window bounds and pandas timestamps are converted in one place, always to UTC; fit days are counted in the configured zone.
Calibration tests write meters in bulk, stamp them in the configured zone and check every azimuth bin; snow feedback has its own slot window test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Code (claude-opus-5-5)
This commit is contained in:
Bobby Noelte
2026-11-15 18:30:00 +01:00
co-authored by Claude Opus 5.5
parent 6fad58655f
commit 2bfb6eafab
3 changed files with 595 additions and 77 deletions
+3 -1
View File
@@ -418,7 +418,9 @@ async def test_calibration_skips_intervals_with_possible_snow(snow_instance, cap
}
)
raw = await snow_instance._forecast_frame(fixture["openmeteo"], calibrate=False)
calibration = await snow_instance._fit_calibration(raw)
calibration = await snow_instance._fit_calibration(
raw, await snow_instance._pv_measurement_window()
)
assert calibration is not None
factors[snow_enabled] = calibration[0]