From d962969519cdaf389ea317a81fe994119a2dcea0 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 26 Apr 2023 17:47:49 +0200 Subject: [PATCH 1/3] solve_network: solve network fix kwargs --- scripts/solve_network.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 1d53bfc4..a272588c 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -633,7 +633,6 @@ def solve_network(n, config, opts="", **kwargs): solver_name=solver_name, extra_functionality=extra_functionality, linearized_unit_commitment=linearized_unit_commitment, - linearized_unit_commitment=linearized_unit_commitment, **solver_options, **kwargs, ) From e6f0d8a9901f5b702898d86a2571e4366cce6972 Mon Sep 17 00:00:00 2001 From: lisazeyen Date: Wed, 26 Apr 2023 18:07:02 +0200 Subject: [PATCH 2/3] fix bug load shedding constraint --- scripts/solve_network.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index a272588c..7a462924 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -169,7 +169,7 @@ def prepare_network(n, solve_opts=None, config=None): "Generator", buses_i, " load", - bus=n.buses.index, + bus=buses_i, carrier="load", sign=1e-3, # Adjust sign to measure p and p_nom in kW instead of MW marginal_cost=load_shedding, # Eur/kWh @@ -657,20 +657,20 @@ def solve_network(n, config, opts="", **kwargs): return n - +#%% if __name__ == "__main__": if "snakemake" not in globals(): from _helpers import mock_snakemake snakemake = mock_snakemake( - "solve_sector_network", - configfiles="test/config.overnight.yaml", + "solve_network", + # configfiles="test/config.overnight.yaml", simpl="", opts="", - clusters="5", - ll="v1.5", - sector_opts="CO2L0-24H-T-H-B-I-A-solar+p3-dist1", - planning_horizons="2030", + clusters="37", + ll="v1.0", + sector_opts="", + planning_horizons="2020", ) configure_logging(snakemake) if "sector_opts" in snakemake.wildcards.keys(): From 9ae7a93ccb01bcb3570ef7e2c3120ab725720245 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 16:07:26 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/solve_network.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 7a462924..d4dd537f 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -657,7 +657,8 @@ def solve_network(n, config, opts="", **kwargs): return n -#%% + +# %% if __name__ == "__main__": if "snakemake" not in globals(): from _helpers import mock_snakemake