Merge pull request #672 from koen-vg/fix-h2-underground-storage

Fix bug with underground H2 storage creation
This commit is contained in:
Fabian Neumann 2023-05-24 11:39:32 +02:00 committed by GitHub
commit 015a6a19f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1105,7 +1105,11 @@ def add_storage_and_grids(n, costs):
cavern_types = snakemake.config["sector"]["hydrogen_underground_storage_locations"]
h2_caverns = pd.read_csv(snakemake.input.h2_cavern, index_col=0)
if not h2_caverns.empty and options["hydrogen_underground_storage"]:
if (
not h2_caverns.empty
and options["hydrogen_underground_storage"]
and set(cavern_types).intersection(h2_caverns.columns)
):
h2_caverns = h2_caverns[cavern_types].sum(axis=1)
# only use sites with at least 2 TWh potential