From 72f3334fc1fa4ff96ba88e69686802cb1566e88d Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Wed, 13 Mar 2024 20:59:32 +0000 Subject: [PATCH] fix --- src/gsp.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/gsp.py b/src/gsp.py index 24feeb3..e341bf6 100644 --- a/src/gsp.py +++ b/src/gsp.py @@ -107,17 +107,16 @@ 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 - ] - 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) - else: - logger.warning("Could not find gsp id 0 in the forecasts") + 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) + else: + logger.debug("Not running adjuster as no gsp_id==0 were found") return forecasts