Skip to content

Commit 3cde758

Browse files
author
Micha
authored
Merge branch 'main' into update-pinned-environment
2 parents e5490ce + 3013997 commit 3cde758

File tree

93 files changed

+5319
-3109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+5319
-3109
lines changed

.github/workflows/validate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
step: run-self-hosted-validation
2525
env_file: envs/environment.yaml
26-
snakemake_config: config/config.yaml
26+
snakemake_config: config/config.de.yaml
2727
pre_command: "build_scenarios -f"
2828
main_command: "ariadne_all"
2929
env:
@@ -48,7 +48,7 @@ jobs:
4848
- uses: PyPSA/[email protected]
4949
with:
5050
step: create-comment
51-
snakemake_config: config/config.yaml
51+
snakemake_config: config/config.de.yaml
5252
# The path starting from prefix in config
5353
# For plot results/<prefix>/<scenario>/<plot_name>.png pass
5454
# <scenario>/<plot_name>.png

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@ doc/_build
3030
/scripts/create_scenarios.py
3131
/config/create_scenarios.py
3232

33-
config/config.yaml
3433
config/scenarios.yaml
3534
config/scenarios.automated.yaml
3635

37-
config/config.yaml
38-
3936
dconf
4037
/data/links_p_nom.csv
4138
/data/*totals.csv

CODEOWNERS

Lines changed: 0 additions & 51 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ clean-tests:
7474

7575
# Removes all created files except for large cutout files (similar to fresh clone)
7676
reset:
77-
@echo "Do you really wanna continue? This will remove config/config.yaml, logs, resources, benchmarks, results, and .snakemake directories (y/n): " && \
77+
@echo "Do you really wanna continue? This will remove logs, resources, benchmarks, results, and .snakemake directories (y/n): " && \
7878
read ans && [ $${ans} = y ] && ( \
7979
rm -r ./logs || true; \
8080
rm -r ./resources || true; \
8181
rm -r ./benchmarks || true; \
8282
rm -r ./results || true; \
8383
rm -r ./.snakemake || true; \
84-
rm ./config/config.yaml || true; \
8584
echo "Reset completed." \
8685
) || echo "Reset cancelled."

Snakefile

Lines changed: 95 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@ min_version("8.11")
1313

1414
from scripts._helpers import (
1515
path_provider,
16-
copy_default_files,
1716
get_scenarios,
1817
get_rdir,
1918
get_shadow,
2019
)
2120

2221

23-
copy_default_files(workflow)
24-
25-
2622
configfile: "config/config.default.yaml"
27-
configfile: "config/config.yaml"
28-
configfile: "config/config.personal.yaml"
23+
configfile: "config/plotting.default.yaml"
24+
configfile: "config/config.de.yaml"
2925

3026

3127
run = config["run"]
@@ -53,7 +49,6 @@ localrules:
5349

5450
wildcard_constraints:
5551
clusters="[0-9]+(m|c)?|all|adm",
56-
ll=r"(v|c)([0-9\.]+|opt)",
5752
opts=r"[-+a-zA-Z0-9\.]*",
5853
sector_opts=r"[-+a-zA-Z0-9\.\s]*",
5954
planning_horizons=r"[0-9]{4}",
@@ -66,7 +61,6 @@ include: "rules/build_electricity.smk"
6661
include: "rules/build_sector.smk"
6762
include: "rules/solve_electricity.smk"
6863
include: "rules/postprocess.smk"
69-
include: "rules/validate.smk"
7064
include: "rules/development.smk"
7165

7266

@@ -88,6 +82,70 @@ if config["foresight"] == "perfect":
8882
rule all:
8983
input:
9084
expand(RESULTS + "graphs/costs.svg", run=config["run"]["name"]),
85+
expand(
86+
resources("maps/power-network-s-{clusters}.pdf"),
87+
run=config["run"]["name"],
88+
**config["scenario"],
89+
),
90+
expand(
91+
RESULTS
92+
+ "maps/base_s_{clusters}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
93+
run=config["run"]["name"],
94+
**config["scenario"],
95+
),
96+
lambda w: expand(
97+
(
98+
RESULTS
99+
+ "maps/base_s_{clusters}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf"
100+
if config_provider("sector", "H2_network")(w)
101+
else []
102+
),
103+
run=config["run"]["name"],
104+
**config["scenario"],
105+
),
106+
lambda w: expand(
107+
(
108+
RESULTS
109+
+ "maps/base_s_{clusters}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf"
110+
if config_provider("sector", "gas_network")(w)
111+
else []
112+
),
113+
run=config["run"]["name"],
114+
**config["scenario"],
115+
),
116+
lambda w: expand(
117+
(
118+
RESULTS + "csvs/cumulative_costs.csv"
119+
if config_provider("foresight")(w) == "myopic"
120+
else []
121+
),
122+
run=config["run"]["name"],
123+
),
124+
lambda w: expand(
125+
(
126+
RESULTS
127+
+ "maps/base_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}-balance_map_{carrier}.pdf"
128+
),
129+
**config["scenario"],
130+
run=config["run"]["name"],
131+
carrier=config_provider("plotting", "balance_map", "bus_carriers")(w),
132+
),
133+
directory(
134+
expand(
135+
RESULTS
136+
+ "graphics/balance_timeseries/s_{clusters}_{opts}_{sector_opts}_{planning_horizons}",
137+
run=config["run"]["name"],
138+
**config["scenario"],
139+
),
140+
),
141+
directory(
142+
expand(
143+
RESULTS
144+
+ "graphics/heatmap_timeseries/s_{clusters}_{opts}_{sector_opts}_{planning_horizons}",
145+
run=config["run"]["name"],
146+
**config["scenario"],
147+
),
148+
),
91149
default_target: True
92150

93151

@@ -116,13 +174,13 @@ rule purge:
116174
raise Exception(f"Input {do_purge}. Aborting purge.")
117175

118176

119-
rule dag:
177+
rule rulegraph:
120178
message:
121-
"Creating DAG of workflow."
179+
"Creating RULEGRAPH dag of workflow."
122180
output:
123-
dot=resources("dag.dot"),
124-
pdf=resources("dag.pdf"),
125-
png=resources("dag.png"),
181+
dot=resources("dag_rulegraph.dot"),
182+
pdf=resources("dag_rulegraph.pdf"),
183+
png=resources("dag_rulegraph.png"),
126184
conda:
127185
"envs/environment.yaml"
128186
shell:
@@ -133,6 +191,23 @@ rule dag:
133191
"""
134192

135193

194+
rule filegraph:
195+
message:
196+
"Creating FILEGRAPH dag of workflow."
197+
output:
198+
dot=resources("dag_filegraph.dot"),
199+
pdf=resources("dag_filegraph.pdf"),
200+
png=resources("dag_filegraph.png"),
201+
conda:
202+
"envs/environment.yaml"
203+
shell:
204+
r"""
205+
snakemake --filegraph all | sed -n "/digraph/,\$p" > {output.dot}
206+
dot -Tpdf -o {output.pdf} {output.dot}
207+
dot -Tpng -o {output.png} {output.dot}
208+
"""
209+
210+
136211
rule doc:
137212
message:
138213
"Build documentation."
@@ -359,8 +434,9 @@ rule modify_prenetwork:
359434
regions_offshore=resources("regions_offshore_base_s_{clusters}.geojson"),
360435
offshore_connection_points="ariadne-data/offshore_connection_points.csv",
361436
output:
362-
network=RESULTS
363-
+ "networks/base_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}_final.nc",
437+
network=resources(
438+
"networks/base_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}_final.nc"
439+
),
364440
resources:
365441
mem_mb=4000,
366442
log:
@@ -508,6 +584,7 @@ rule export_ariadne_variables:
508584
params:
509585
planning_horizons=config_provider("scenario", "planning_horizons"),
510586
hours=config_provider("clustering", "temporal", "resolution_sector"),
587+
max_hours=config_provider("electricity", "max_hours"),
511588
costs=config_provider("costs"),
512589
config_industry=config_provider("industry"),
513590
energy_totals_year=config_provider("energy", "energy_totals_year"),
@@ -680,6 +757,7 @@ rule plot_ariadne_report:
680757
run=config_provider("run", "name"),
681758
foresight=config_provider("foresight"),
682759
costs=config_provider("costs"),
760+
max_hours=config_provider("electricity", "max_hours"),
683761
post_discretization=config_provider("solving", "options", "post_discretization"),
684762
NEP_year=config_provider("costs", "NEP"),
685763
hours=config_provider("clustering", "temporal", "resolution_sector"),
@@ -702,13 +780,13 @@ rule plot_ariadne_report:
702780
**config["scenario"],
703781
allow_missing=True,
704782
),
783+
exported_variables_full=RESULTS + "ariadne/exported_variables_full.xlsx",
705784
output:
706785
elec_price_duration_curve=RESULTS
707786
+ "ariadne/report/elec_price_duration_curve.pdf",
708787
elec_price_duration_hist=RESULTS + "ariadne/report/elec_price_duration_hist.pdf",
709788
backup_capacity=RESULTS + "ariadne/report/backup_capacity.pdf",
710789
backup_generation=RESULTS + "ariadne/report/backup_generation.pdf",
711-
elec_prices_spatial_de=RESULTS + "ariadne/report/elec_prices_spatial_de.pdf",
712790
results=directory(RESULTS + "ariadne/report"),
713791
elec_transmission=directory(RESULTS + "ariadne/report/elec_transmission"),
714792
h2_transmission=directory(RESULTS + "ariadne/report/h2_transmission"),
@@ -717,7 +795,7 @@ rule plot_ariadne_report:
717795
heat_balances=directory(RESULTS + "ariadne/report/heat_balance_timeseries"),
718796
nodal_balances=directory(RESULTS + "ariadne/report/balance_timeseries_2045"),
719797
resources:
720-
mem_mb=30000,
798+
mem_mb=32000,
721799
log:
722800
RESULTS + "logs/plot_ariadne_report.log",
723801
script:
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: 20250404-fit_for_2050
7+
prefix: 20250414_merge_master_april
88
name:
99
# - CurrentPolicies
1010
- KN2045_Bal_v4

0 commit comments

Comments
 (0)