Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 30a6ff9

Browse files
JulianGeispre-commit-ci[bot]lindnemi
authored
Add plotting of hydrogen network including the Kernnetz (#71)
* created local script in Ariadne, added rule to Snakefile * add kernnetz to the hydrogen_map plotting function * changed logic to plot all maps at once * revert functionality to plot network after each run * add result to ariadne_all rule to trigger plotting * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * plot only capacity which is build in the investment period not cumulative * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix missing plots * reset to file contents of main * remove duplicate line * improve numerical stability * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Michael Lindner <michaellindner@posteo.de>
1 parent dd457cb commit 30a6ff9

File tree

4 files changed

+402
-2
lines changed

4 files changed

+402
-2
lines changed

config/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
66
run:
7-
prefix: 20240926_meoh_load
7+
prefix: 20240927plotH2Kernnetz
88
name:
99
# - CurrentPolicies
1010
- KN2045_Bal_v4

workflow/Snakefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,13 @@ rule ariadne_all:
570570
RESULTS + "ariadne/capacity_detailed.png",
571571
run=config_provider("run", "name"),
572572
),
573+
expand(
574+
RESULTS
575+
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_incl_kernnetz_{planning_horizons}.pdf",
576+
run=config_provider("run", "name"),
577+
**config["scenario"],
578+
allow_missing=True,
579+
),
573580
exported_variables=expand(
574581
RESULTS + "ariadne/exported_variables_full.xlsx",
575582
run=config_provider("run", "name"),
@@ -602,3 +609,29 @@ rule check_sector_ratios:
602609
"logs/check_sector_ratios.log",
603610
script:
604611
"scripts/check_sector_ratios.py"
612+
613+
614+
rule plot_hydrogen_network_incl_kernnetz:
615+
params:
616+
plotting=config_provider("plotting"),
617+
foresight=config_provider("foresight"),
618+
input:
619+
network=RESULTS
620+
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
621+
regions=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
622+
output:
623+
map=RESULTS
624+
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_incl_kernnetz_{planning_horizons}.pdf",
625+
threads: 2
626+
resources:
627+
mem_mb=10000,
628+
log:
629+
RESULTS
630+
+ "logs/plot_hydrogen_network_incl_kernnetz/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log",
631+
benchmark:
632+
(
633+
RESULTS
634+
+ "benchmarks/plot_hydrogen_network_incl_kernnetz/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
635+
)
636+
script:
637+
"scripts/plot_hydrogen_network_incl_kernnetz.py"

workflow/scripts/export_ariadne_variables.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def _get_fuel_fractions(n, region, fuel):
150150
).sum()
151151
- renewable_fuel_supply.get(f"DE renewable {fuel}", pd.Series(0)).sum(),
152152
rtol=1e-3,
153+
atol=1e-5,
153154
)
154155

155156
fuel_fractions = pd.Series()
@@ -4464,7 +4465,7 @@ def get_data(
44644465

44654466
if "debug" == "debug": # For debugging
44664467
var = pd.Series()
4467-
idx = 0
4468+
idx = -1
44684469
n = networks[idx]
44694470
c = costs[idx]
44704471
_industry_demand = industry_demands[idx]

0 commit comments

Comments
 (0)