File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/india_api/internal/inputs/indiadb Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def get_predicted_power_production_for_location(
62
62
"""Gets the predicted power production for a location.
63
63
64
64
Args:
65
- location: not used
65
+ location: the location to get the predicted power production for
66
66
asset_type: The type of asset to get the forecast for
67
67
forecast_horizon: The time horizon to get the data for. Can be latest or day ahead
68
68
forecast_horizon_minutes: The number of minutes to get the forecast for. forecast_horizon must be 'horizon'
@@ -91,6 +91,16 @@ def get_predicted_power_production_for_location(
91
91
92
92
# just select wind site
93
93
sites = [s for s in sites if s .asset_type == asset_type ]
94
+
95
+ # just select region
96
+ sites = [site for site in sites if site .region == location ]
97
+
98
+ if len (sites ) == 0 :
99
+ raise HTTPException (
100
+ status_code = 204 ,
101
+ detail = f"Site for { location = } not found and { asset_type = } not found" ,
102
+ )
103
+
94
104
site = sites [0 ]
95
105
96
106
# read actual generations
You can’t perform that action at this time.
0 commit comments