From ed5ede2bea635a738956005ff12a62d9e83fab3c Mon Sep 17 00:00:00 2001 From: energyls Date: Tue, 8 Aug 2023 09:08:28 +0200 Subject: [PATCH] fix: update logger errors --- scripts/add_export.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/add_export.py b/scripts/add_export.py index 9eec06aa..8819fa2e 100644 --- a/scripts/add_export.py +++ b/scripts/add_export.py @@ -149,10 +149,10 @@ def create_export_profile(): if np.abs(export_profile.sum() - export_h2) > 1: # Threshold of 1 MWh logger.error( - f"Sum of ship profile ({export_profile.sum().values[0]/1e6} TWh) does not match export demand ({export_h2} TWh)" + f"Sum of ship profile ({export_profile.sum()/1e6} TWh) does not match export demand ({export_h2} TWh)" ) raise ValueError( - f"Sum of ship profile ({export_profile.sum().values[0]/1e6} TWh) does not match export demand ({export_h2} TWh)" + f"Sum of ship profile ({export_profile.sum()/1e6} TWh) does not match export demand ({export_h2} TWh)" ) # Resample to temporal resolution defined in wildcard "sopts" with pandas resample @@ -160,8 +160,9 @@ def create_export_profile(): export_profile = export_profile.resample(sopts[0]).mean() # revise logger msg + export_type = snakemake.config["export"]["export_profile"] logger.info( - f"The yearly export demand is {export_h2/1e6} TWh and resampled to {sopts[0]}" + f"The yearly export demand is {export_h2/1e6} TWh, profile generated based on {export_type} method and resampled to {sopts[0]}" ) return export_profile