fixup! base_network: Don't update the capacity of TYNDP links from links_p_nom

This commit is contained in:
Jonas Hörsch 2018-10-09 15:44:20 +02:00
parent 3edc075628
commit 6f3b44e5e4

View File

@ -218,7 +218,7 @@ def _set_electrical_parameters_links(links):
p_nom = links_p_nom.dropna(subset=["j"]).set_index("j")["Power (MW)"]
# Don't update p_nom if it's already set
p_nom_unset = p_nom.drop(links.index[links.p_nom.notnull()], errors='ignore')
p_nom_unset = p_nom.drop(links.index[links.p_nom.notnull()], errors='ignore') if "p_nom" in links else p_nom
links.loc[p_nom_unset.index, "p_nom"] = p_nom_unset
return links