Skip to content

Commit

Permalink
make_summary: Remove erroneous power outputs for non-multi links
Browse files Browse the repository at this point in the history
This bug in PyPSA was fixed in:

PyPSA/PyPSA@f484adc
  • Loading branch information
nworbmot committed May 13, 2020
1 parent 1c5f471 commit eb34356
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/make_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit eb34356

Please sign in to comment.