Version Checks (indicate both or one)
Issue Description
The scenario management does not work if the config without the scenarios applied does not define scenarios.planning_horizon. This even applies if the scenarios overwrite this value.
If scenarios.planning_horizon is set in the default config, everything seems to work properly and the value is overwritten.
edit: There is another issue (bug or undocumented feature) that I came across. The run:name key needs to be set to run:name="all", else the scenario management is also refusing to run all the scenarios. In the examples below, change the run:name to something else and see for yourself...
Reproducible Example
Use the standard PyPSA-Eur setup with config.default.yaml etc. inside the Snakefile. Then create the following additional configuration files:
# scenarios.yaml
2030:
scenario:
planning_horizons:
- 2030
# working.config.yaml
run:
prefix: ""
name: "all"
scenarios:
enable: true
file: scenarios.yaml
scenario:
planning_horizons:
- "2050"
# not-working.config.yaml
run:
prefix: ""
name: "all"
scenarios:
enable: true
file: scenarios.yaml
scenario:
planning_horizons:
- ""
Running snakemake --configfile working.config.yaml -n yields a DAG with networks for planning_horizon=2030.
Running snakemake --configfile not-working.config.yaml -n leads to the following error:
MissingInputException in rule make_global_summary in file "<pypsa-eur>/rules/postprocess.smk", line 254:
Missing input files for rule make_global_summary:
output: results/csvs/costs.csv, results/csvs/capacities.csv, results/csvs/energy.csv, results/csvs/energy_balance.csv, results/csvs/capacity_factors.csv, results/csvs/metrics.csv, results/csvs/curtailment.csv, results/csvs/prices.csv, results/csvs/weighted_prices.csv, results/csvs/market_values.csv, results/csvs/nodal_costs.csv, results/csvs/nodal_capacities.csv, results/csvs/nodal_energy_balance.csv, results/csvs/nodal_capacity_factors.csv
affected files:
results/csvs/individual/nodal_capacity_factors_s_50___.csv
results/csvs/individual/nodal_energy_balance_s_50___.csv
results/csvs/individual/costs_s_50___.csv
results/csvs/individual/energy_balance_s_50___.csv
results/csvs/individual/weighted_prices_s_50___.csv
results/csvs/individual/prices_s_50___.csv
results/csvs/individual/metrics_s_50___.csv
results/csvs/individual/curtailment_s_50___.csv
results/csvs/individual/nodal_costs_s_50___.csv
results/csvs/individual/capacity_factors_s_50___.csv
results/csvs/individual/nodal_capacities_s_50___.csv
results/csvs/individual/capacities_s_50___.csv
results/csvs/individual/market_values_s_50___.csv
results/csvs/individual/energy_s_50___.csv
Expected Behavior
Allow for planning_horizon to be empty.
Installed Versions
Details
Replace this line.
Version Checks (indicate both or one)
I have confirmed this bug exists on the lastest release of PyPSA-Eur.
I have confirmed this bug exists on the current
masterbranch of PyPSA-Eur.Issue Description
The scenario management does not work if the
configwithout the scenarios applied does not definescenarios.planning_horizon. This even applies if the scenarios overwrite this value.If
scenarios.planning_horizonis set in the default config, everything seems to work properly and the value is overwritten.edit: There is another issue (bug or undocumented feature) that I came across. The
run:namekey needs to be set torun:name="all", else the scenario management is also refusing to run all the scenarios. In the examples below, change therun:nameto something else and see for yourself...Reproducible Example
Use the standard PyPSA-Eur setup with
config.default.yamletc. inside theSnakefile. Then create the following additional configuration files:Running
snakemake --configfile working.config.yaml -nyields a DAG with networks forplanning_horizon=2030.Running
snakemake --configfile not-working.config.yaml -nleads to the following error:Expected Behavior
Allow for
planning_horizonto be empty.Installed Versions
Details
Replace this line.