File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
nowcasting_datamodel/read Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ def get_latest_forecast(
121
121
gsp_id : Optional [int ] = None ,
122
122
historic : bool = False ,
123
123
start_target_time : Optional [datetime ] = None ,
124
+ forecast_horizon_minutes : Optional [int ] = None ,
124
125
) -> ForecastSQL :
125
126
"""
126
127
Read forecasts
@@ -144,7 +145,11 @@ def get_latest_forecast(
144
145
gsp_ids = None
145
146
146
147
forecasts = get_latest_forecast_for_gsps (
147
- session = session , start_target_time = start_target_time , historic = historic , gsp_ids = gsp_ids
148
+ session = session ,
149
+ start_target_time = start_target_time ,
150
+ historic = historic ,
151
+ gsp_ids = gsp_ids ,
152
+ forecast_horizon_minutes = forecast_horizon_minutes ,
148
153
)
149
154
150
155
if forecasts is None :
@@ -310,7 +315,7 @@ def get_latest_forecast_for_gsps(
310
315
)
311
316
query = query .join (ForecastValueSQL ).filter (
312
317
ForecastValueSQL .target_time - ForecastValueSQL .created_utc
313
- >= text (f"interval '{ forecast_horizon_minutes } hour '" )
318
+ >= text (f"interval '{ forecast_horizon_minutes } minute '" )
314
319
)
315
320
316
321
query = query .join (LocationSQL )
You can’t perform that action at this time.
0 commit comments