Skip to content

Commit 3a5fed6

Browse files
committed
lint
1 parent fc929aa commit 3a5fed6

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

src/india_api/internal/inputs/indiadb/client.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def get_predicted_power_production_for_location(
111111
day_ahead_hours=day_ahead_hours,
112112
day_ahead_timezone_delta_hours=day_ahead_timezone_delta_hours,
113113
forecast_horizon_minutes=forecast_horizon_minutes,
114-
model_name=ml_model_name
114+
model_name=ml_model_name,
115115
)
116116
forecast_values: [ForecastValueSQL] = values[site.site_uuid]
117117

@@ -187,16 +187,15 @@ def get_predicted_solar_power_production_for_location(
187187
"""
188188

189189
# set this to be hard coded for now
190-
model_name = 'pvnet_india'
191-
190+
model_name = "pvnet_india"
192191

193192
return self.get_predicted_power_production_for_location(
194193
location=location,
195194
asset_type=SiteAssetType.pv,
196195
forecast_horizon=forecast_horizon,
197196
forecast_horizon_minutes=forecast_horizon_minutes,
198197
smooth_flag=smooth_flag,
199-
model_name=model_name
198+
model_name=model_name,
200199
)
201200

202201
def get_predicted_wind_power_production_for_location(
@@ -217,7 +216,7 @@ def get_predicted_wind_power_production_for_location(
217216
"""
218217

219218
# set this to be hard coded for now
220-
model_name = 'windnet_india'
219+
model_name = "windnet_india"
221220

222221
return self.get_predicted_power_production_for_location(
223222
location=location,
@@ -273,13 +272,13 @@ def get_sites(self, email: str) -> list[internal.Site]:
273272

274273
return sites
275274

276-
def get_site_forecast(self, site_uuid: str, email:str) -> list[internal.PredictedPower]:
275+
def get_site_forecast(self, site_uuid: str, email: str) -> list[internal.PredictedPower]:
277276
"""Get a forecast for a site, this is for a solar site"""
278277

279278
# TODO feels like there is some duplicated code here which could be refactored
280279

281280
# hard coded model name
282-
ml_model_name = 'pvnet_ad_sites'
281+
ml_model_name = "pvnet_ad_sites"
283282

284283
# Get the window
285284
start, _ = get_window()
@@ -291,10 +290,7 @@ def get_site_forecast(self, site_uuid: str, email:str) -> list[internal.Predicte
291290
site_uuid = UUID(site_uuid)
292291

293292
values = get_latest_forecast_values_by_site(
294-
session,
295-
site_uuids=[site_uuid],
296-
start_utc=start,
297-
model_name=ml_model_name
293+
session, site_uuids=[site_uuid], start_utc=start, model_name=ml_model_name
298294
)
299295
forecast_values: [ForecastValueSQL] = values[site_uuid]
300296

@@ -312,7 +308,7 @@ def get_site_forecast(self, site_uuid: str, email:str) -> list[internal.Predicte
312308

313309
return values
314310

315-
def get_site_generation(self, site_uuid: str, email:str) -> list[internal.ActualPower]:
311+
def get_site_generation(self, site_uuid: str, email: str) -> list[internal.ActualPower]:
316312
"""Get the generation for a site, this is for a solar site"""
317313

318314
# TODO feels like there is some duplicated code here which could be refactored
@@ -344,7 +340,9 @@ def get_site_generation(self, site_uuid: str, email:str) -> list[internal.Actual
344340

345341
return values
346342

347-
def post_site_generation(self, site_uuid: str, generation: list[internal.ActualPower], email:str):
343+
def post_site_generation(
344+
self, site_uuid: str, generation: list[internal.ActualPower], email: str
345+
):
348346
"""Post generation for a site"""
349347

350348
with self._get_session() as session:

src/india_api/internal/inputs/indiadb/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def sites(db_session):
6565
ml_id=1,
6666
asset_type="pv",
6767
country="india",
68-
region='testID',
69-
client_site_name='ruvnl_pv_testID1'
68+
region="testID",
69+
client_site_name="ruvnl_pv_testID1",
7070
)
7171
db_session.add(site)
7272
sites.append(site)
@@ -80,16 +80,16 @@ def sites(db_session):
8080
ml_id=2,
8181
asset_type="wind",
8282
country="india",
83-
region='testID',
84-
client_site_name = 'ruvnl_wind_testID'
83+
region="testID",
84+
client_site_name="ruvnl_wind_testID",
8585
)
8686
db_session.add(site)
8787
sites.append(site)
8888

8989
db_session.commit()
9090

9191
# create user
92-
user = get_user_by_email(session=db_session, email='test@test.com')
92+
user = get_user_by_email(session=db_session, email="test@test.com")
9393
user.site_group.sites = sites
9494

9595
db_session.commit()

0 commit comments

Comments
 (0)