From 82fe4df3419c4019bfef4b5a3fa1780df031b881 Mon Sep 17 00:00:00 2001 From: Emmanuel Bolarinwa Date: Sat, 20 Jul 2024 10:18:42 +0100 Subject: [PATCH 1/2] modified config to fix nan objective value --- test/config.test1.yaml | 4 ++-- test/config.test_myopic.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/config.test1.yaml b/test/config.test1.yaml index c4d344fe..388f8a44 100644 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -28,7 +28,7 @@ scenario: opts: - "Co2L" sopts: - - "144H" + - "24H" demand: - "AB" @@ -328,7 +328,7 @@ solving: options: formulation: kirchhoff clip_p_max_pu: 1.e-2 - load_shedding: false + load_shedding: true noisy_costs: true skip_iterations: true track_iterations: false diff --git a/test/config.test_myopic.yaml b/test/config.test_myopic.yaml index c241574a..758cbf1c 100644 --- a/test/config.test_myopic.yaml +++ b/test/config.test_myopic.yaml @@ -27,7 +27,7 @@ scenario: opts: - "Co2L" sopts: - - "144H" + - "24H" demand: - "DF" @@ -331,7 +331,7 @@ solving: options: formulation: kirchhoff clip_p_max_pu: 1.e-2 - load_shedding: false + load_shedding: true noisy_costs: true skip_iterations: true track_iterations: false From cf3db59ae2e17782177d0af5e915f81ae340f548 Mon Sep 17 00:00:00 2001 From: Emmanuel Bolarinwa Date: Mon, 22 Jul 2024 11:11:47 +0100 Subject: [PATCH 2/2] print objective value to terminal --- scripts/solve_network.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 1104d845..1b31efff 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -616,6 +616,10 @@ def add_existing(n): n.meta = dict(snakemake.config, **dict(wildcards=dict(snakemake.wildcards))) n.export_to_netcdf(snakemake.output[0]) + # logging output to the terminal + print("Objective function: {}".format(n.objective)) + + # logging output to file logger.info("Objective function: {}".format(n.objective)) logger.info("Objective constant: {}".format(n.objective_constant)) logger.info("Maximum memory usage: {}".format(mem.mem_usage))