2024-01-25 19:34:59 +00:00
|
|
|
# SPDX-FileCopyrightText: : 2023-2024 The PyPSA-Eur Authors
|
2023-03-08 16:29:01 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2023-03-08 16:46:14 +00:00
|
|
|
|
|
|
|
localrules:
|
|
|
|
copy_config,
|
|
|
|
|
2023-03-08 16:29:01 +00:00
|
|
|
|
2023-08-22 09:01:00 +00:00
|
|
|
if config["foresight"] != "perfect":
|
2023-08-30 10:05:16 +00:00
|
|
|
|
2023-08-14 16:25:58 +00:00
|
|
|
rule plot_power_network_clustered:
|
|
|
|
params:
|
|
|
|
plotting=config["plotting"],
|
|
|
|
input:
|
|
|
|
network=RESOURCES + "networks/elec_s{simpl}_{clusters}.nc",
|
2024-01-25 19:50:03 +00:00
|
|
|
regions_onshore=RESOURCES
|
|
|
|
+ "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-08-14 16:25:58 +00:00
|
|
|
output:
|
2024-01-25 19:51:51 +00:00
|
|
|
map=RESULTS + "maps/power-network-s{simpl}-{clusters}.pdf",
|
2023-08-14 16:25:58 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=4000,
|
|
|
|
benchmark:
|
|
|
|
BENCHMARKS + "plot_power_network_clustered/elec_s{simpl}_{clusters}"
|
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
|
|
|
"../scripts/plot_power_network_clustered.py"
|
|
|
|
|
2024-01-25 19:34:59 +00:00
|
|
|
rule plot_power_network:
|
2023-08-22 09:01:00 +00:00
|
|
|
params:
|
|
|
|
plotting=config["plotting"],
|
|
|
|
input:
|
|
|
|
network=RESULTS
|
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
regions=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
|
|
|
output:
|
|
|
|
map=RESULTS
|
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
|
|
|
(
|
|
|
|
BENCHMARKS
|
2024-01-25 19:34:59 +00:00
|
|
|
+ "plot_power_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
2023-08-22 09:01:00 +00:00
|
|
|
)
|
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
2024-01-25 19:34:59 +00:00
|
|
|
"../scripts/plot_power_network.py"
|
|
|
|
|
|
|
|
rule plot_hydrogen_network:
|
|
|
|
params:
|
|
|
|
plotting=config["plotting"],
|
|
|
|
input:
|
|
|
|
network=RESULTS
|
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
regions=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
|
|
|
output:
|
|
|
|
map=RESULTS
|
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf",
|
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
|
|
|
(
|
|
|
|
BENCHMARKS
|
|
|
|
+ "plot_hydrogen_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
|
|
|
)
|
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
|
|
|
"../scripts/plot_hydrogen_network.py"
|
|
|
|
|
|
|
|
rule plot_gas_network:
|
|
|
|
params:
|
|
|
|
plotting=config["plotting"],
|
|
|
|
input:
|
|
|
|
network=RESULTS
|
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
regions=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
|
|
|
output:
|
|
|
|
map=RESULTS
|
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf",
|
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
|
|
|
(
|
|
|
|
BENCHMARKS
|
|
|
|
+ "plot_gas_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
|
|
|
)
|
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
|
|
|
"../scripts/plot_gas_network.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
2023-08-30 10:05:16 +00:00
|
|
|
|
2023-08-22 09:01:00 +00:00
|
|
|
if config["foresight"] == "perfect":
|
2023-08-30 10:05:16 +00:00
|
|
|
|
2024-01-25 19:34:59 +00:00
|
|
|
rule plot_power_network_perfect:
|
2023-08-22 09:01:00 +00:00
|
|
|
params:
|
|
|
|
plotting=config["plotting"],
|
|
|
|
input:
|
|
|
|
network=RESULTS
|
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years.nc",
|
|
|
|
regions=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
|
|
|
output:
|
2023-08-24 13:32:23 +00:00
|
|
|
**{
|
|
|
|
f"map_{year}": RESULTS
|
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_"
|
|
|
|
+ f"{year}.pdf"
|
|
|
|
for year in config["scenario"]["planning_horizons"]
|
|
|
|
},
|
2023-08-22 09:01:00 +00:00
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
2023-03-08 18:22:29 +00:00
|
|
|
BENCHMARKS
|
2023-08-30 10:05:16 +00:00
|
|
|
+"postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years_benchmark"
|
2023-08-22 09:01:00 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
2024-01-25 19:34:59 +00:00
|
|
|
"../scripts/plot_power_network_perfect.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule copy_config:
|
|
|
|
params:
|
|
|
|
RDIR=RDIR,
|
|
|
|
output:
|
2023-08-02 12:31:08 +00:00
|
|
|
RESULTS + "config.yaml",
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
2023-03-08 18:22:00 +00:00
|
|
|
BENCHMARKS + "copy_config"
|
2023-03-08 16:46:14 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/copy_config.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule make_summary:
|
|
|
|
params:
|
2023-05-15 08:33:17 +00:00
|
|
|
foresight=config["foresight"],
|
|
|
|
costs=config["costs"],
|
2023-09-23 16:39:11 +00:00
|
|
|
snapshots={k: config["snapshots"][k] for k in ["start", "end", "inclusive"]},
|
2023-05-15 08:33:17 +00:00
|
|
|
scenario=config["scenario"],
|
2023-03-08 16:29:01 +00:00
|
|
|
RDIR=RDIR,
|
|
|
|
input:
|
2024-01-26 16:06:20 +00:00
|
|
|
expand(
|
|
|
|
RESULTS + "maps/power-network-s{simpl}-{clusters}.pdf",
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
2023-03-08 16:29:01 +00:00
|
|
|
networks=expand(
|
|
|
|
RESULTS
|
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
|
|
|
costs="data/costs_{}.csv".format(config["costs"]["year"])
|
|
|
|
if config["foresight"] == "overnight"
|
|
|
|
else "data/costs_{}.csv".format(config["scenario"]["planning_horizons"][0]),
|
2024-01-26 16:07:19 +00:00
|
|
|
ac_plot=expand(
|
2024-01-26 16:05:38 +00:00
|
|
|
RESULTS + "maps/power-network-s{simpl}-{clusters}.pdf",
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
|
|
|
costs_plot=expand(
|
|
|
|
RESULTS
|
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
|
|
|
h2_plot=expand(
|
|
|
|
RESULTS
|
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf"
|
|
|
|
if config["sector"]["H2_network"]
|
|
|
|
else [],
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
|
|
|
ch4_plot=expand(
|
|
|
|
RESULTS
|
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf"
|
|
|
|
if config["sector"]["gas_network"]
|
|
|
|
else [],
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
|
|
|
nodal_costs=RESULTS + "csvs/nodal_costs.csv",
|
|
|
|
nodal_capacities=RESULTS + "csvs/nodal_capacities.csv",
|
|
|
|
nodal_cfs=RESULTS + "csvs/nodal_cfs.csv",
|
|
|
|
cfs=RESULTS + "csvs/cfs.csv",
|
|
|
|
costs=RESULTS + "csvs/costs.csv",
|
|
|
|
capacities=RESULTS + "csvs/capacities.csv",
|
|
|
|
curtailment=RESULTS + "csvs/curtailment.csv",
|
|
|
|
energy=RESULTS + "csvs/energy.csv",
|
|
|
|
supply=RESULTS + "csvs/supply.csv",
|
|
|
|
supply_energy=RESULTS + "csvs/supply_energy.csv",
|
|
|
|
prices=RESULTS + "csvs/prices.csv",
|
|
|
|
weighted_prices=RESULTS + "csvs/weighted_prices.csv",
|
|
|
|
market_values=RESULTS + "csvs/market_values.csv",
|
|
|
|
price_statistics=RESULTS + "csvs/price_statistics.csv",
|
|
|
|
metrics=RESULTS + "csvs/metrics.csv",
|
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
2023-03-08 18:22:00 +00:00
|
|
|
log:
|
2023-03-08 18:22:29 +00:00
|
|
|
LOGS + "make_summary.log",
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2023-03-08 18:22:00 +00:00
|
|
|
BENCHMARKS + "make_summary"
|
2023-03-08 16:46:14 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/make_summary.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule plot_summary:
|
|
|
|
params:
|
2023-05-15 08:33:17 +00:00
|
|
|
countries=config["countries"],
|
2023-05-27 13:50:37 +00:00
|
|
|
planning_horizons=config["scenario"]["planning_horizons"],
|
|
|
|
sector_opts=config["scenario"]["sector_opts"],
|
2023-08-09 12:35:39 +00:00
|
|
|
emissions_scope=config["energy"]["emissions"],
|
|
|
|
eurostat_report_year=config["energy"]["eurostat_report_year"],
|
2023-05-15 08:33:17 +00:00
|
|
|
plotting=config["plotting"],
|
2023-03-08 16:29:01 +00:00
|
|
|
RDIR=RDIR,
|
|
|
|
input:
|
|
|
|
costs=RESULTS + "csvs/costs.csv",
|
|
|
|
energy=RESULTS + "csvs/energy.csv",
|
|
|
|
balances=RESULTS + "csvs/supply_energy.csv",
|
|
|
|
eurostat=input_eurostat,
|
2023-08-24 09:11:33 +00:00
|
|
|
co2="data/bundle-sector/eea/UNFCCC_v23.csv",
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
|
|
|
costs=RESULTS + "graphs/costs.pdf",
|
|
|
|
energy=RESULTS + "graphs/energy.pdf",
|
|
|
|
balances=RESULTS + "graphs/balances-energy.pdf",
|
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
2023-03-08 18:22:00 +00:00
|
|
|
log:
|
2023-03-08 18:22:29 +00:00
|
|
|
LOGS + "plot_summary.log",
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2023-03-08 18:22:00 +00:00
|
|
|
BENCHMARKS + "plot_summary"
|
2023-03-08 16:46:14 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:46:14 +00:00
|
|
|
"../scripts/plot_summary.py"
|
2023-07-03 15:13:16 +00:00
|
|
|
|
|
|
|
|
2023-07-05 09:07:36 +00:00
|
|
|
STATISTICS_BARPLOTS = [
|
|
|
|
"capacity_factor",
|
|
|
|
"installed_capacity",
|
|
|
|
"optimal_capacity",
|
|
|
|
"capital_expenditure",
|
|
|
|
"operational_expenditure",
|
|
|
|
"curtailment",
|
|
|
|
"supply",
|
|
|
|
"withdrawal",
|
|
|
|
"market_value",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2023-08-04 10:23:02 +00:00
|
|
|
rule plot_elec_statistics:
|
2023-07-05 09:07:36 +00:00
|
|
|
params:
|
|
|
|
plotting=config["plotting"],
|
|
|
|
barplots=STATISTICS_BARPLOTS,
|
2023-07-03 15:13:16 +00:00
|
|
|
input:
|
|
|
|
network=RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
|
|
|
output:
|
2023-07-05 09:07:36 +00:00
|
|
|
**{
|
|
|
|
f"{plot}_bar": RESULTS
|
|
|
|
+ f"figures/statistics_{plot}_bar_elec_s{{simpl}}_{{clusters}}_ec_l{{ll}}_{{opts}}.pdf"
|
|
|
|
for plot in STATISTICS_BARPLOTS
|
|
|
|
},
|
|
|
|
barplots_touch=RESULTS
|
|
|
|
+ "figures/.statistics_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}",
|
2023-07-03 15:13:16 +00:00
|
|
|
script:
|
|
|
|
"../scripts/plot_statistics.py"
|