From 4cfb06c55f96c619a5ff18df1f435d75eb147e28 Mon Sep 17 00:00:00 2001 From: Michael Lindner Date: Wed, 17 Jan 2024 17:07:19 +0100 Subject: [PATCH 1/3] group storage with duplicate labels --- scripts/plot_network.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/plot_network.py b/scripts/plot_network.py index 67481120..650a24ef 100644 --- a/scripts/plot_network.py +++ b/scripts/plot_network.py @@ -273,7 +273,7 @@ def plot_h2_map(network, regions): h2_storage = n.stores.query("carrier == 'H2'") regions["H2"] = h2_storage.rename( index=h2_storage.bus.map(n.buses.location) - ).e_nom_opt.div( + ).e_nom_opt.groupby(level=0).sum().div( 1e6 ) # TWh regions["H2"] = regions["H2"].where(regions["H2"] > 0.1) @@ -1068,9 +1068,10 @@ if __name__ == "__main__": "plot_network", simpl="", opts="", - clusters="37", - ll="v1.0", - sector_opts="4380H-T-H-B-I-A-solar+p3-dist1", + clusters="22", + ll="v1.2", + sector_opts="365H-T-H-B-I-A-solar+p3-linemaxext15", + planning_horizons="2040", ) logging.basicConfig(level=snakemake.config["logging"]["level"]) From e07f0e5c2b5bb34e8fcfb3b127ac9e30109beedc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:09:36 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/plot_network.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/plot_network.py b/scripts/plot_network.py index 650a24ef..31e72289 100644 --- a/scripts/plot_network.py +++ b/scripts/plot_network.py @@ -271,10 +271,11 @@ def plot_h2_map(network, regions): assign_location(n) h2_storage = n.stores.query("carrier == 'H2'") - regions["H2"] = h2_storage.rename( - index=h2_storage.bus.map(n.buses.location) - ).e_nom_opt.groupby(level=0).sum().div( - 1e6 + regions["H2"] = ( + h2_storage.rename(index=h2_storage.bus.map(n.buses.location)) + .e_nom_opt.groupby(level=0) + .sum() + .div(1e6) ) # TWh regions["H2"] = regions["H2"].where(regions["H2"] > 0.1) From dd8db719accb6faf71fd194227211cedd1bb9950 Mon Sep 17 00:00:00 2001 From: Michael Lindner Date: Thu, 18 Jan 2024 13:53:59 +0100 Subject: [PATCH 3/3] revert accidental changes --- scripts/plot_network.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/plot_network.py b/scripts/plot_network.py index 31e72289..63b5d848 100644 --- a/scripts/plot_network.py +++ b/scripts/plot_network.py @@ -1069,10 +1069,9 @@ if __name__ == "__main__": "plot_network", simpl="", opts="", - clusters="22", - ll="v1.2", - sector_opts="365H-T-H-B-I-A-solar+p3-linemaxext15", - planning_horizons="2040", + clusters="37", + ll="v1.0", + sector_opts="4380H-T-H-B-I-A-solar+p3-dist1", ) logging.basicConfig(level=snakemake.config["logging"]["level"])