Version Checks (indicate both or one)
Issue Description
A PyPSA v1.1.x regression causes
|
flow = n.statistics.transmission(groupby=False, bus_carrier=carrier) |
to return an empty series because at_port in transmission() changed its default from False (port 0 only) to None. When bus_carrier is specified, None now resolves to "all" ports — meaning p0 and p1 cancel each other out (opposite sign), summing to zero and being dropped. Result: empty Series.
I suposedly fixed it using at_port=[0]
flow = n.statistics.transmission(groupby=False, bus_carrier=carrier, at_port=[0])
and results show up again. I did not open the PR with a fix, because I suspect there are more places where transmission(...) is used.
Reproducible Example
running with pypsa < 1.1
n.statistics.transmission(groupby=False, bus_carrier=carrier)
# expected non-empty
running with pypsa >= 1.1
n.statistics.transmission(groupby=False, bus_carrier=carrier)
# returns empty Series (bug)
running with pypsa >= 1.1
n.statistics.transmission(groupby=False, bus_carrier=carrier, at_port=[0])
# returns same as before v1.1
Expected Behavior
# with pypsa >= 1.1
n.statistics.transmission(groupby=False, bus_carrier=carrier, at_port=[0])
returns same as
# with pypsa < 1.1
n.statistics.transmission(groupby=False, bus_carrier=carrier)
Installed Versions
Details
pypsa 1.1.2 pyhd8ed1ab_0 236.6 KiB conda https://conda.anaconda.org/conda-forge/
Version Checks (indicate both or one)
I have confirmed this bug exists on the lastest release of PyPSA-Eur.
I have confirmed this bug exists on the current
masterbranch of PyPSA-Eur.Issue Description
A PyPSA v1.1.x regression causes
pypsa-eur/scripts/plot_balance_map_interactive.py
Line 138 in f85d295
to return an empty series because
at_portintransmission()changed its default fromFalse(port 0 only) toNone. When bus_carrier is specified,Nonenow resolves to "all" ports — meaningp0andp1cancel each other out (opposite sign), summing to zero and being dropped. Result: empty Series.I suposedly fixed it using
at_port=[0]and results show up again. I did not open the PR with a fix, because I suspect there are more places where
transmission(...)is used.Reproducible Example
Expected Behavior
returns same as
Installed Versions
Details
pypsa 1.1.2 pyhd8ed1ab_0 236.6 KiB conda https://conda.anaconda.org/conda-forge/