@@ -31,6 +31,7 @@ class GetSourcesResponse(BaseModel):
31
31
@router .get (
32
32
"/sources" ,
33
33
status_code = status .HTTP_200_OK ,
34
+ include_in_schema = False ,
34
35
)
35
36
def get_sources_route (auth : dict = Depends (auth )) -> GetSourcesResponse :
36
37
"""Function for the sources route."""
@@ -60,6 +61,7 @@ def validate_source(source: str) -> str:
60
61
@router .get (
61
62
"/{source}/regions" ,
62
63
status_code = status .HTTP_200_OK ,
64
+ include_in_schema = False ,
63
65
)
64
66
def get_regions_route (
65
67
source : ValidSourceDependency ,
@@ -85,6 +87,7 @@ class GetHistoricGenerationResponse(BaseModel):
85
87
@router .get (
86
88
"/{source}/{region}/generation" ,
87
89
status_code = status .HTTP_200_OK ,
90
+ include_in_schema = False ,
88
91
)
89
92
def get_historic_timeseries_route (
90
93
source : ValidSourceDependency ,
@@ -126,6 +129,7 @@ class GetForecastGenerationResponse(BaseModel):
126
129
@router .get (
127
130
"/{source}/{region}/forecast" ,
128
131
status_code = status .HTTP_200_OK ,
132
+ include_in_schema = False ,
129
133
)
130
134
def get_forecast_timeseries_route (
131
135
source : ValidSourceDependency ,
@@ -178,7 +182,9 @@ def get_forecast_timeseries_route(
178
182
179
183
180
184
@router .get (
181
- "/{source}/{region}/forecast/csv" , response_class = FileResponse
185
+ "/{source}/{region}/forecast/csv" ,
186
+ response_class = FileResponse ,
187
+ include_in_schema = False ,
182
188
)
183
189
def get_forecast_da_csv (
184
190
source : ValidSourceDependency ,
@@ -191,7 +197,12 @@ def get_forecast_da_csv(
191
197
"""
192
198
193
199
forcasts : GetForecastGenerationResponse = get_forecast_timeseries_route (
194
- source = source , region = region , db = db , auth = auth , forecast_horizon = ForecastHorizon .day_ahead , smooth_flag = False
200
+ source = source ,
201
+ region = region ,
202
+ db = db ,
203
+ auth = auth ,
204
+ forecast_horizon = ForecastHorizon .day_ahead ,
205
+ smooth_flag = False ,
195
206
)
196
207
197
208
# format to dataframe
@@ -202,8 +213,10 @@ def get_forecast_da_csv(
202
213
tomorrow_ist = df ["Date [IST]" ].iloc [0 ]
203
214
csv_file_path = f"{ region } _{ source } _da_{ tomorrow_ist } .csv"
204
215
205
- description = f"Forecast for { region } for { source } for { tomorrow_ist } . " \
206
- f"The Forecast was created at { created_time } and downloaded at { now_ist } "
216
+ description = (
217
+ f"Forecast for { region } for { source } for { tomorrow_ist } . "
218
+ f"The Forecast was created at { created_time } and downloaded at { now_ist } "
219
+ )
207
220
208
221
output = df .to_csv (index = False )
209
222
return StreamingResponse (
0 commit comments