Skip to content

Commit cfa2743

Browse files
committed
fix bug on directory creation
1 parent 1490f47 commit cfa2743

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

scripts/pypsa-de/regret_plots.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ def aggregate_by_keywords(opex_comp_agg, groups):
105105
networks[year][scenario][decision] = pypsa.Network(fn)
106106

107107
# ensure output directory exist
108-
for dir in snakemake.output[-1]:
109-
if not os.path.exists(dir):
110-
os.makedirs(dir)
108+
if not os.path.exists(snakemake.output[-1]):
109+
os.makedirs(snakemake.output[-1])
111110

112111
# Plot electricity price duration curves
113112

scripts/pypsa-de/regret_plots_lt.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,8 @@ def plot_capacity_comparison(
256256
vars_dict["LowDemand"] = df
257257

258258
# ensure output directory exist
259-
for dir in snakemake.output[-1]:
260-
if not os.path.exists(dir):
261-
os.makedirs(dir)
259+
if not os.path.exists(snakemake.output[-1]):
260+
os.makedirs(snakemake.output[-1])
262261

263262
# Capacity plot DE
264263

0 commit comments

Comments
 (0)