From cadd33431fba87c6a679519ef9e3f19d2955d517 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Mon, 13 May 2024 17:59:21 +0200 Subject: [PATCH] sanitize_locations: avoid attribute error for electricity-only runs (closes #939) --- scripts/add_extra_components.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/add_extra_components.py b/scripts/add_extra_components.py index eb14436e..90e7eaec 100644 --- a/scripts/add_extra_components.py +++ b/scripts/add_extra_components.py @@ -246,7 +246,8 @@ if __name__ == "__main__": attach_hydrogen_pipelines(n, costs, extendable_carriers) sanitize_carriers(n, snakemake.config) - sanitize_locations(n) + if "location" in n.buses: + sanitize_locations(n) n.meta = dict(snakemake.config, **dict(wildcards=dict(snakemake.wildcards))) n.export_to_netcdf(snakemake.output[0])