Fix clash of names in creation of candidate network for H2

Sometimes Lines and Links have same name, so need MultiIndex to avoid
a clash of names.
This commit is contained in:
Tom Brown 2019-12-26 10:21:22 +00:00
parent 9a5ae01a92
commit 0e5dcbbce4
2 changed files with 4 additions and 3 deletions

View File

@ -40,8 +40,8 @@ projects % git clone git@github.com:nworbmot/pypsa-eur-sec.git
The requirements are the same as
[PyPSA-Eur](https://github.com/PyPSA/pypsa-eur), but for
`solve_network.py` in addition you need `gurobipy` and version
>=0.16.0 of PyPSA in order to use the `nomopyomo` framework. These
`solve_network.py` in addition you need `gurobipy` and version 0.16.0
or greater of PyPSA in order to use the `nomopyomo` framework. These
libraries are currently imported "by hand" at the start of the
`solve_network.py` script.

View File

@ -540,7 +540,8 @@ def add_storage(network):
connector = " -> "
attrs = ["bus0","bus1","length"]
candidates = pd.concat([n.lines[attrs],n.links.loc[n.links.carrier == "DC",attrs]])
candidates = pd.concat([n.lines[attrs],n.links.loc[n.links.carrier == "DC",attrs]],
keys=["lines","links"])
for candidate in candidates.index:
buses = [candidates.at[candidate,"bus0"],candidates.at[candidate,"bus1"]]