Skip to content

Commit

Permalink
reduce logging
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Sep 7, 2023
1 parent 29a3899 commit ab0dba9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,22 @@ def format_plevels(national_forecast_value: NationalForecastValue):
if (not isinstance(national_forecast_value.plevels, dict)) or (
national_forecast_value.plevels == {}
):
logger.warning(f"Using default properties for {national_forecast_value.__fields__.keys()}")
national_forecast_value.plevels = {
"plevel_10": national_forecast_value.expected_power_generation_megawatts * 0.8,
"plevel_90": national_forecast_value.expected_power_generation_megawatts * 1.2,
}
logger.debug(f"{national_forecast_value.plevels}")

# rename '10' and '90' to plevel_10 and plevel_90
for c in ["10", "90"]:
if c in national_forecast_value.plevels.keys():
national_forecast_value.plevels[f"plevel_{c}"] = national_forecast_value.plevels.pop(c)

if national_forecast_value.plevels["plevel_10"] is None:
logger.debug("Setting plevel_10 to default")
national_forecast_value.plevels["plevel_10"] = (
national_forecast_value.expected_power_generation_megawatts * 0.8
)

if national_forecast_value.plevels["plevel_90"] is None:
logger.debug("Setting plevel_90 to default")
national_forecast_value.plevels["plevel_90"] = (
national_forecast_value.expected_power_generation_megawatts * 1.2
)
Expand Down

0 comments on commit ab0dba9

Please sign in to comment.