Skip to content

Commit 781d10f

Browse files
committed
lint
1 parent 5c51169 commit 781d10f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

nowcasting_datamodel/update.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
from sqlalchemy.orm.session import Session
99

1010
from nowcasting_datamodel.models.models import ForecastSQL, ForecastValueLatestSQL
11-
from nowcasting_datamodel.read.read import get_latest_forecast, get_model, get_latest_forecast_for_gsps
11+
from nowcasting_datamodel.read.read import (
12+
get_latest_forecast,
13+
get_model,
14+
get_latest_forecast_for_gsps,
15+
)
1216

1317
logger = logging.getLogger(__name__)
1418

@@ -66,7 +70,9 @@ def upsert(session: Session, model, rows: List[dict]):
6670
session.execute(stmt, rows)
6771

6872

69-
def update_forecast_latest(forecast: ForecastSQL, session: Session, forecast_historic: Optional[ForecastSQL] = None):
73+
def update_forecast_latest(
74+
forecast: ForecastSQL, session: Session, forecast_historic: Optional[ForecastSQL] = None
75+
):
7076
"""
7177
Update the forecast_values table
7278
@@ -116,7 +122,11 @@ def update_all_forecast_latest(forecasts: List[ForecastSQL], session: Session):
116122

117123
# chose the correct forecast historic
118124
gsp_id = forecast.location.gsp_id
119-
forecast_historic = [forecast for forecast in forecasts_historic if forecast.location.gsp_id == gsp_id]
125+
forecast_historic = [
126+
forecast for forecast in forecasts_historic if forecast.location.gsp_id == gsp_id
127+
]
120128
forecast_historic = forecast_historic[0]
121129

122-
update_forecast_latest(forecast=forecast, session=session, forecast_historic=forecast_historic)
130+
update_forecast_latest(
131+
forecast=forecast, session=session, forecast_historic=forecast_historic
132+
)

0 commit comments

Comments
 (0)