From ebb5da655ef8627d534e1995df18fdeac93b54b2 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 17 Aug 2023 12:56:34 +0200 Subject: [PATCH] scenarios: add collect function plot_elec_networks --- rules/collect.smk | 10 ++++++++++ scripts/plot_statistics.py | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/rules/collect.smk b/rules/collect.smk index 8a64b577..70dc4641 100644 --- a/rules/collect.smk +++ b/rules/collect.smk @@ -76,6 +76,16 @@ rule solve_sector_networks: ), +rule plot_elec_networks: + input: + expand( + RESULTS + + "figures/.statistics_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}", + **config["scenario"], + run=config["run"]["name"] + ), + + rule plot_networks: input: expand( diff --git a/scripts/plot_statistics.py b/scripts/plot_statistics.py index a0a3e71d..11293c08 100644 --- a/scripts/plot_statistics.py +++ b/scripts/plot_statistics.py @@ -61,7 +61,7 @@ if __name__ == "__main__": fig, ax = plt.subplots() ds = n.statistics.installed_capacity().dropna() ds = ds.drop("Line") - ds = ds.drop(("Generator", "Load")) + ds = ds.drop(("Generator", "Load"), errors="ignore") ds = ds / 1e3 ds.attrs["unit"] = "GW" plot_static_per_carrier(ds, ax) @@ -70,7 +70,7 @@ if __name__ == "__main__": fig, ax = plt.subplots() ds = n.statistics.optimal_capacity() ds = ds.drop("Line") - ds = ds.drop(("Generator", "Load")) + ds = ds.drop(("Generator", "Load"), errors="ignore") ds = ds / 1e3 ds.attrs["unit"] = "GW" plot_static_per_carrier(ds, ax)