make_summary: Remove erroneous power outputs for non-multi links

This bug in PyPSA was fixed in:

f484adc876
This commit is contained in:
Tom Brown 2020-05-13 13:25:32 +02:00
parent 1c5f471acb
commit eb34356722

View File

@ -250,7 +250,11 @@ def calculate_energy(n,label,energy):
else:
c_energies = pd.Series(0.,c.df.carrier.unique())
for port in [col[3:] for col in c.df.columns if col[:3] == "bus"]:
c_energies -= c.pnl["p"+port].multiply(n.snapshot_weightings,axis=0).sum().groupby(c.df.carrier).sum()
totals = c.pnl["p"+port].multiply(n.snapshot_weightings,axis=0).sum()
#remove values where bus is missing (bug in nomopyomo)
no_bus = c.df.index[c.df["bus"+port] == ""]
totals.loc[no_bus] = n.component_attrs[c.name].loc["p"+port,"default"]
c_energies -= totals.groupby(c.df.carrier).sum()
c_energies = pd.concat([c_energies], keys=[c.list_name])