From 9f91af28e727e77285c9761876b6e5657dd71ed4 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 23 Jun 2022 15:17:41 +0200 Subject: [PATCH] fix syntax errors --- scripts/plot_network.py | 6 +++--- scripts/plot_summary.py | 4 ++-- scripts/prepare_sector_network.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/plot_network.py b/scripts/plot_network.py index 61f91df1..3f7c6960 100644 --- a/scripts/plot_network.py +++ b/scripts/plot_network.py @@ -309,7 +309,7 @@ def plot_h2_map(network): ) n.plot( - geomap=False, + # geomap=False, bus_sizes=0, link_colors='#72d3d6', link_widths=link_widths_retro, @@ -443,7 +443,7 @@ def plot_ch4_map(network): ) n.plot( - geomap=False, + # geomap=False, ax=ax, bus_sizes=0., link_colors='#e8d1d1', @@ -453,7 +453,7 @@ def plot_ch4_map(network): ) n.plot( - geomap=False, + # geomap=False, ax=ax, bus_sizes=0., link_colors=link_color_used, diff --git a/scripts/plot_summary.py b/scripts/plot_summary.py index 97166f54..f58c81af 100644 --- a/scripts/plot_summary.py +++ b/scripts/plot_summary.py @@ -51,7 +51,7 @@ def rename_techs(label): "ror": "hydroelectricity", "hydro": "hydroelectricity", "PHS": "hydroelectricity", - "NH3": "ammonia" + "NH3": "ammonia", "co2 Store": "DAC", "co2 stored": "CO2 sequestration", "AC": "transmission lines", @@ -256,7 +256,7 @@ def plot_balances(): df = df / 1e6 #remove trailing link ports - df.index = [i[:-1] if ((i != "co2") and (i[-1:] in ["0","1","2","3"])) else i for i in df.index] + df.index = [i[:-1] if ((i not in ["co2", "NH3"]) and (i[-1:] in ["0","1","2","3"])) else i for i in df.index] df = df.groupby(df.index.map(rename_techs)).sum() diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 64207f0c..f56b3606 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -100,7 +100,7 @@ def define_spatial(nodes, options): spatial.ammonia.nodes = nodes + " NH3" spatial.ammonia.locations = nodes else: - spatial.ammonia.nodes = ["EU ammonia"] + spatial.ammonia.nodes = ["EU NH3"] spatial.ammonia.locations = ["EU"] spatial.ammonia.df = pd.DataFrame(vars(spatial.ammonia), index=nodes) @@ -690,8 +690,8 @@ def add_ammonia(n, costs): bus2=nodes + " H2", p_nom_extendable=True, carrier="Haber-Bosch", - efficiency=1 / (cf_industry["MWh_elec_per_tNH3_electrolysis"] / cf_industry["MWh_NH3_per_tNH3"]) # output: MW_NH3 per MW_elec - efficiency2=-cf_industry["MWh_H2_per_tNH3_electrolysis"] / cf_industry["MWh_elec_per_tNH3_electrolysis"] # input: MW_H2 per MW_elec + efficiency=1 / (cf_industry["MWh_elec_per_tNH3_electrolysis"] / cf_industry["MWh_NH3_per_tNH3"]), # output: MW_NH3 per MW_elec + efficiency2=-cf_industry["MWh_H2_per_tNH3_electrolysis"] / cf_industry["MWh_elec_per_tNH3_electrolysis"], # input: MW_H2 per MW_elec capital_cost=costs.at["Haber-Bosch synthesis", "fixed"], lifetime=costs.at["Haber-Bosch synthesis", 'lifetime'] ) @@ -703,7 +703,7 @@ def add_ammonia(n, costs): bus1=nodes + " H2", p_nom_extendable=True, carrier="ammonia cracker", - efficiency=1 / cf_industry["MWh_NH3_per_MWh_H2_cracker"] + efficiency=1 / cf_industry["MWh_NH3_per_MWh_H2_cracker"], capital_cost=costs.at["Ammonia cracker", "fixed"] / cf_industry["MWh_NH3_per_MWh_H2_cracker"], # given per MW_H2 lifetime=costs.at['Ammonia cracker', 'lifetime'] )