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
|
|
|
|
2024-02-12 10:53:37 +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:
|
2024-02-10 16:22:01 +00:00
|
|
|
plotting=config_provider("plotting"),
|
2023-08-14 16:25:58 +00:00
|
|
|
input:
|
2024-09-13 13:37:01 +00:00
|
|
|
network=resources("networks/base_s_{clusters}.nc"),
|
|
|
|
regions_onshore=resources("regions_onshore_base_s_{clusters}.geojson"),
|
2023-08-14 16:25:58 +00:00
|
|
|
output:
|
2024-09-13 13:37:01 +00:00
|
|
|
map=resources("maps/power-network-s-{clusters}.pdf"),
|
2023-08-14 16:25:58 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=4000,
|
|
|
|
benchmark:
|
2024-09-13 13:37:01 +00:00
|
|
|
benchmarks("plot_power_network_clustered/base_s_{clusters}")
|
2023-08-14 16:25:58 +00:00
|
|
|
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:
|
2024-02-10 16:22:01 +00:00
|
|
|
plotting=config_provider("plotting"),
|
2023-08-22 09:01:00 +00:00
|
|
|
input:
|
|
|
|
network=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "postnetworks/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
regions=resources("regions_onshore_base_s_{clusters}.geojson"),
|
2023-08-22 09:01:00 +00:00
|
|
|
output:
|
|
|
|
map=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "maps/base_s_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
2023-08-22 09:01:00 +00:00
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
2024-02-07 16:53:10 +00:00
|
|
|
log:
|
2024-02-17 22:36:46 +00:00
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "logs/plot_power_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log",
|
2023-08-22 09:01:00 +00:00
|
|
|
benchmark:
|
2024-02-17 22:36:46 +00:00
|
|
|
(
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "benchmarks/plot_power_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
2024-02-10 17:09:23 +00:00
|
|
|
)
|
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:
|
2024-02-10 16:22:01 +00:00
|
|
|
plotting=config_provider("plotting"),
|
|
|
|
foresight=config_provider("foresight"),
|
2024-01-25 19:34:59 +00:00
|
|
|
input:
|
|
|
|
network=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "postnetworks/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
regions=resources("regions_onshore_base_s_{clusters}.geojson"),
|
2024-01-25 19:34:59 +00:00
|
|
|
output:
|
|
|
|
map=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "maps/base_s_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf",
|
2024-01-25 19:34:59 +00:00
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
2024-02-07 16:53:10 +00:00
|
|
|
log:
|
2024-02-17 22:36:46 +00:00
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "logs/plot_hydrogen_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log",
|
2024-01-25 19:34:59 +00:00
|
|
|
benchmark:
|
2024-02-17 22:36:46 +00:00
|
|
|
(
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "benchmarks/plot_hydrogen_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
2024-02-10 17:09:23 +00:00
|
|
|
)
|
2024-01-25 19:34:59 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
|
|
|
"../scripts/plot_hydrogen_network.py"
|
|
|
|
|
|
|
|
rule plot_gas_network:
|
|
|
|
params:
|
2024-02-10 16:22:01 +00:00
|
|
|
plotting=config_provider("plotting"),
|
2024-01-25 19:34:59 +00:00
|
|
|
input:
|
|
|
|
network=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "postnetworks/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
regions=resources("regions_onshore_base_s_{clusters}.geojson"),
|
2024-01-25 19:34:59 +00:00
|
|
|
output:
|
|
|
|
map=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "maps/base_s_{clusters}_l{ll}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf",
|
2024-01-25 19:34:59 +00:00
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
2024-02-07 16:53:10 +00:00
|
|
|
log:
|
2024-02-17 22:36:46 +00:00
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "logs/plot_gas_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log",
|
2024-01-25 19:34:59 +00:00
|
|
|
benchmark:
|
2024-02-17 22:36:46 +00:00
|
|
|
(
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "benchmarks/plot_gas_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
2024-02-10 17:09:23 +00:00
|
|
|
)
|
2024-01-25 19:34:59 +00:00
|
|
|
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
|
|
|
|
2024-02-12 10:53:37 +00:00
|
|
|
if config["foresight"] == "perfect":
|
2023-08-30 10:05:16 +00:00
|
|
|
|
2024-02-12 15:56:00 +00:00
|
|
|
def output_map_year(w):
|
|
|
|
return {
|
|
|
|
f"map_{year}": RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "maps/base_s_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_"
|
2024-02-12 15:56:00 +00:00
|
|
|
+ f"{year}.pdf"
|
|
|
|
for year in config_provider("scenario", "planning_horizons")(w)
|
|
|
|
}
|
|
|
|
|
2024-01-25 19:34:59 +00:00
|
|
|
rule plot_power_network_perfect:
|
2023-08-22 09:01:00 +00:00
|
|
|
params:
|
2024-02-10 16:22:01 +00:00
|
|
|
plotting=config_provider("plotting"),
|
2023-08-22 09:01:00 +00:00
|
|
|
input:
|
|
|
|
network=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "postnetworks/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years.nc",
|
|
|
|
regions=resources("regions_onshore_base_s_{clusters}.geojson"),
|
2023-08-22 09:01:00 +00:00
|
|
|
output:
|
2024-02-12 15:56:00 +00:00
|
|
|
unpack(output_map_year),
|
2023-08-22 09:01:00 +00:00
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
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 make_summary:
|
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
foresight=config_provider("foresight"),
|
|
|
|
costs=config_provider("costs"),
|
2024-02-17 16:16:28 +00:00
|
|
|
snapshots=config_provider("snapshots"),
|
2024-03-14 17:52:25 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2023-08-15 13:02:41 +00:00
|
|
|
scenario=config_provider("scenario"),
|
2023-03-08 16:29:01 +00:00
|
|
|
RDIR=RDIR,
|
|
|
|
input:
|
|
|
|
networks=expand(
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "postnetworks/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2023-08-15 13:02:41 +00:00
|
|
|
**config["scenario"],
|
2024-02-17 22:36:46 +00:00
|
|
|
allow_missing=True,
|
2023-03-08 16:29:01 +00:00
|
|
|
),
|
2024-02-12 15:54:33 +00:00
|
|
|
costs=lambda w: (
|
2024-02-16 10:17:00 +00:00
|
|
|
resources("costs_{}.csv".format(config_provider("costs", "year")(w)))
|
2024-02-12 15:54:33 +00:00
|
|
|
if config_provider("foresight")(w) == "overnight"
|
2024-02-17 16:38:46 +00:00
|
|
|
else resources(
|
|
|
|
"costs_{}.csv".format(
|
|
|
|
config_provider("scenario", "planning_horizons", 0)(w)
|
|
|
|
)
|
|
|
|
)
|
2023-03-08 16:29:01 +00:00
|
|
|
),
|
2024-01-26 16:07:19 +00:00
|
|
|
ac_plot=expand(
|
2024-09-13 13:37:01 +00:00
|
|
|
resources("maps/power-network-s-{clusters}.pdf"),
|
2024-01-26 16:05:38 +00:00
|
|
|
**config["scenario"],
|
2024-02-17 22:36:46 +00:00
|
|
|
allow_missing=True,
|
2024-01-26 16:05:38 +00:00
|
|
|
),
|
|
|
|
costs_plot=expand(
|
2023-03-08 16:29:01 +00:00
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "maps/base_s_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
2023-08-15 13:02:41 +00:00
|
|
|
**config["scenario"],
|
2024-02-17 22:36:46 +00:00
|
|
|
allow_missing=True,
|
2023-03-08 16:29:01 +00:00
|
|
|
),
|
2024-02-17 19:48:17 +00:00
|
|
|
h2_plot=lambda w: expand(
|
2024-02-05 18:23:48 +00:00
|
|
|
(
|
2024-01-26 16:05:38 +00:00
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "maps/base_s_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf"
|
2024-02-17 19:48:17 +00:00
|
|
|
if config_provider("sector", "H2_network")(w)
|
2024-01-26 16:05:38 +00:00
|
|
|
else []
|
|
|
|
),
|
|
|
|
**config["scenario"],
|
2024-02-17 22:36:46 +00:00
|
|
|
allow_missing=True,
|
2024-01-26 16:05:38 +00:00
|
|
|
),
|
2024-02-17 19:48:17 +00:00
|
|
|
ch4_plot=lambda w: expand(
|
2024-02-05 18:23:48 +00:00
|
|
|
(
|
2024-01-26 16:05:38 +00:00
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "maps/base_s_{clusters}_l{ll}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf"
|
2024-02-17 19:48:17 +00:00
|
|
|
if config_provider("sector", "gas_network")(w)
|
2024-01-26 16:05:38 +00:00
|
|
|
else []
|
|
|
|
),
|
|
|
|
**config["scenario"],
|
2024-02-17 22:36:46 +00:00
|
|
|
allow_missing=True,
|
2024-01-26 16:05:38 +00:00
|
|
|
),
|
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",
|
2024-04-12 14:10:00 +00:00
|
|
|
nodal_supply_energy=RESULTS + "csvs/nodal_supply_energy.csv",
|
2023-03-08 16:29:01 +00:00
|
|
|
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:
|
2024-02-16 10:17:00 +00:00
|
|
|
RESULTS + "logs/make_summary.log",
|
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-08-15 13:02:41 +00:00
|
|
|
countries=config_provider("countries"),
|
|
|
|
planning_horizons=config_provider("scenario", "planning_horizons"),
|
2023-08-24 08:19:14 +00:00
|
|
|
emissions_scope=config_provider("energy", "emissions"),
|
2023-08-15 13:02:41 +00:00
|
|
|
plotting=config_provider("plotting"),
|
2024-02-17 16:16:28 +00:00
|
|
|
foresight=config_provider("foresight"),
|
|
|
|
co2_budget=config_provider("co2_budget"),
|
2024-02-17 22:36:46 +00:00
|
|
|
sector=config_provider("sector"),
|
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",
|
2024-05-21 13:59:46 +00:00
|
|
|
eurostat="data/eurostat/Balances-April2023",
|
2024-04-15 12:48:34 +00:00
|
|
|
co2="data/bundle/eea/UNFCCC_v23.csv",
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-06-11 13:10:12 +00:00
|
|
|
costs=RESULTS + "graphs/costs.svg",
|
|
|
|
energy=RESULTS + "graphs/energy.svg",
|
|
|
|
balances=RESULTS + "graphs/balances-energy.svg",
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 2
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
2023-03-08 18:22:00 +00:00
|
|
|
log:
|
2024-02-16 10:17:00 +00:00
|
|
|
RESULTS + "logs/plot_summary.log",
|
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",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-09-13 13:37:01 +00:00
|
|
|
rule plot_base_statistics:
|
2023-07-05 09:07:36 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
plotting=config_provider("plotting"),
|
2023-07-05 09:07:36 +00:00
|
|
|
barplots=STATISTICS_BARPLOTS,
|
2023-07-03 15:13:16 +00:00
|
|
|
input:
|
2024-09-13 13:37:01 +00:00
|
|
|
network=RESULTS + "networks/base_s_{clusters}_elec_l{ll}_{opts}.nc",
|
2023-07-03 15:13:16 +00:00
|
|
|
output:
|
2023-07-05 09:07:36 +00:00
|
|
|
**{
|
|
|
|
f"{plot}_bar": RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ f"figures/statistics_{plot}_bar_base_s_{{clusters}}_elec_l{{ll}}_{{opts}}.pdf"
|
2023-07-05 09:07:36 +00:00
|
|
|
for plot in STATISTICS_BARPLOTS
|
|
|
|
},
|
|
|
|
barplots_touch=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "figures/.statistics_plots_base_s_{clusters}_elec_l{ll}_{opts}",
|
2023-07-03 15:13:16 +00:00
|
|
|
script:
|
|
|
|
"../scripts/plot_statistics.py"
|