pandapower icon indicating copy to clipboard operation
pandapower copied to clipboard

fix key error in unbalanced powerflow if trafo index is not consecutive or not starting at zero

Open jkupka opened this issue 1 year ago • 1 comments

Running pp.runpp_3ph fails with a key error if trafo index is not starting at 0 or it is not consecutive.

Minimal example:

import pandapower as pp
import pandapower.networks as nw

net = nw.ieee_european_lv_asymmetric("on_peak_566")
net.trafo.loc[1] = net.trafo.loc[0]
net.trafo.drop(0, inplace=True)

pp.runpp_3ph(net) # -> KeyError: 0

Fixed by this PR.

jkupka avatar Feb 06 '24 22:02 jkupka

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.65%. Comparing base (685ca90) to head (a0cf82e).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2217   +/-   ##
========================================
  Coverage    79.65%   79.65%           
========================================
  Files          255      255           
  Lines        27841    27841           
========================================
  Hits         22178    22178           
  Misses        5663     5663           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 06 '24 22:02 codecov[bot]