minor code cleaning

This commit is contained in:
Fabian Neumann 2021-07-02 15:08:06 +02:00
parent 89eccd4f70
commit 81b009e062
2 changed files with 5 additions and 6 deletions

View File

@ -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():

View File

@ -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",