From 81b009e0623f149c2c7695bd83ac56e43d5ae9fd Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Fri, 2 Jul 2021 15:08:06 +0200 Subject: [PATCH] minor code cleaning --- scripts/build_clustered_population_layouts.py | 1 - scripts/prepare_sector_network.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/build_clustered_population_layouts.py b/scripts/build_clustered_population_layouts.py index 6f89a25b..0ad1af99 100644 --- a/scripts/build_clustered_population_layouts.py +++ b/scripts/build_clustered_population_layouts.py @@ -5,7 +5,6 @@ import xarray as xr import pandas as pd import atlite -cutout_path = snakemake.config['atlite']['cutout_dir'] + "/" + snakemake.config['atlite']['cutout_name']+ ".nc" if __name__ == '__main__': if 'snakemake' not in globals(): diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 5416413f..76a4a000 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -850,12 +850,12 @@ def add_electricity_grid_connection(n, costs): n.generators.loc[gens, "capital_cost"] += costs.at['electricity grid connection', 'fixed'] -def add_storage(network): +def add_storage(n, costs): print("adding electricity and hydrogen storage") nodes = pop_layout.index - network.add("Carrier", "H2") + n.add("Carrier", "H2") n.madd("Bus", nodes + " H2", @@ -934,9 +934,9 @@ def add_storage(network): buses.sort() name = f"H2 pipeline {buses[0]} -> {buses[1]}" if name not in h2_links.index: - h2_links.at[name,"bus0"] = buses[0] - h2_links.at[name,"bus1"] = buses[1] - h2_links.at[name,"length"] = candidates.at[candidate,"length"] + h2_links.at[name, "bus0"] = buses[0] + h2_links.at[name, "bus1"] = buses[1] + h2_links.at[name, "length"] = candidates.at[candidate, "length"] # TODO Add efficiency losses n.madd("Link",