Skip to content

Commit

Permalink
Merge commit '0f513aefda8929b434623dbaa6f5568f8c5ee0c3' into update-f…
Browse files Browse the repository at this point in the history
…orecast-all-creation-limit
  • Loading branch information
peterdudfield committed Mar 13, 2024
2 parents a42fd06 + 0f513ae commit 51b89af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/gsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def get_all_available_forecasts(

# adjust gsp_id 0
if 0 in gsp_ids:
idx = [i for i, forecasts in enumerate(forecasts.forecasts) if forecasts.location.gsp_id == 0]
idx = [
i
for i, forecasts in enumerate(forecasts.forecasts)
if forecasts.location.gsp_id == 0
]
if len(idx) > 0:
logger.info(f"Adjusting forecast values for gsp id 0, {adjust_limit}")
forecasts.forecasts[idx[0]] = forecasts.forecasts[idx[0]].adjust(limit=adjust_limit)
Expand Down
2 changes: 1 addition & 1 deletion src/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def convert_forecasts_to_many_datetime_many_generation(
forecast_mw = forecast_value.expected_power_generation_megawatts

# adjust the value if gsp id 0, this is the national
if gsp_id == '0':
if gsp_id == "0":
adjust_mw = forecast_value.adjust_mw
if adjust_mw > adjust_limit:
adjust_mw = adjust_limit
Expand Down

0 comments on commit 51b89af

Please sign in to comment.