Fix: Use issued_at instead of target_at for zero-hour resolved truth timestamps

The zero-hour forecasts (observations) were being saved with resolved_at = target_at,
which could be in the future. This caused them to be filtered out by the time-based
query in load_display_dataset(). Now using issued_at (when the observation was made)
ensures the timestamps fall within the valid display range.
This commit is contained in:
rpotter6298
2026-04-25 21:00:34 +02:00
parent 9d15860f0b
commit 0814e7c965
4 changed files with 549 additions and 2 deletions
+2 -2
View File
@@ -183,7 +183,7 @@ class WeatherStore:
) -> int:
truth_points = [
WeatherResolvedTruth(
resolved_at=point.target_at,
resolved_at=point.issued_at,
source="open_meteo_zero_hour",
temperature_c=point.temperature_c,
shortwave_radiation_w_m2=point.shortwave_radiation_w_m2,
@@ -237,7 +237,7 @@ class WeatherStore:
ORDER BY resolved_at
LIMIT 5000
""",
(start_at, end_at),
(start_at, now),
)
truth_rows = cursor.fetchall()