@@ -192,23 +192,20 @@ def get_forecast_csv(
192
192
db : DBClientDependency ,
193
193
auth : dict = Depends (auth ),
194
194
forecast_horizon : Optional [ForecastHorizon ] = ForecastHorizon .latest ,
195
- forecast_horizon_minutes : Optional [int ] = 0 ,
196
195
):
197
196
"""
198
197
Route to get the day ahead forecast as a CSV file.
199
198
By default, the CSV file will be for the latest forecast, from now forwards.
200
- The forecast_horizon can be set to 'latest', 'day_ahead' or 'horizon '.
199
+ The forecast_horizon can be set to 'latest' or 'day_ahead '.
201
200
- latest: The latest forecast, from now forwards.
202
- - day_ahead: The forecast for the next day, from midnight.
203
- - horizon: The forecast for the next horizon_horizon_minutes minutes, from default forecast history start.
204
- The forecast_horizon_minutes is only used if the forecast_horizon is set to 'horizon'.
201
+ - day_ahead: The forecast for the next day, from 00:00.
205
202
"""
206
203
207
204
if forecast_horizon is not None :
208
- if forecast_horizon not in [ForecastHorizon .latest , ForecastHorizon .day_ahead , ForecastHorizon . horizon ]:
205
+ if forecast_horizon not in [ForecastHorizon .latest , ForecastHorizon .day_ahead ]:
209
206
raise HTTPException (
210
207
status_code = status .HTTP_400_BAD_REQUEST ,
211
- detail = f"Invalid forecast_horizon { forecast_horizon } . Must be 'latest', 'day_ahead', or 'horizon ." ,
208
+ detail = f"Invalid forecast_horizon { forecast_horizon } . Must be 'latest' or 'day_ahead' ." ,
212
209
)
213
210
214
211
forecasts : GetForecastGenerationResponse = get_forecast_timeseries_route (
@@ -217,7 +214,6 @@ def get_forecast_csv(
217
214
db = db ,
218
215
auth = auth ,
219
216
forecast_horizon = forecast_horizon ,
220
- forecast_horizon_minutes = forecast_horizon_minutes ,
221
217
smooth_flag = False ,
222
218
)
223
219
@@ -232,11 +228,11 @@ def get_forecast_csv(
232
228
forecast_type = "intraday"
233
229
case ForecastHorizon .day_ahead :
234
230
forecast_type = "da"
235
- case ForecastHorizon .horizon :
236
- forecast_type = f"horizon_{ forecast_horizon_minutes } "
237
231
case _:
238
- # this shouldn't happen but will handle if class is changed
239
- forecast_type = "default"
232
+ raise HTTPException (
233
+ status_code = status .HTTP_400_BAD_REQUEST ,
234
+ detail = f"Invalid forecast_horizon { forecast_horizon } . Must be 'latest' or 'day_ahead'." ,
235
+ )
240
236
csv_file_path = f"{ region } _{ source } _{ forecast_type } _{ tomorrow_ist } .csv"
241
237
242
238
description = (
0 commit comments