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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user