Skip to content

Commit 42cf4bc

Browse files
committed
actually resolve all warning messages
Signed-off-by: Martijn Govers <[email protected]>
1 parent ec9ebeb commit 42cf4bc

File tree

3 files changed

+245
-210
lines changed

3 files changed

+245
-210
lines changed

src/power_grid_model_io/converters/pandapower_converter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,10 @@ def _create_pgm_input_transformers(self): # pylint: disable=too-many-statements
757757
valid = np.logical_and(np.not_equal(sn_mva, 0.0), np.isfinite(sn_mva))
758758
mag_g = np.divide(pfe, sn_mva * 1000, where=valid)
759759
mag_g[np.logical_not(valid)] = np.nan
760-
rx_mag = mag_g / np.sqrt(i_no_load * i_no_load * 1e-4 - mag_g * mag_g)
760+
z_squared = i_no_load * i_no_load * 1e-4 - mag_g * mag_g
761+
valid = np.logical_and(np.greater(z_squared, 0), np.isfinite(z_squared))
762+
rx_mag = np.divide(mag_g, np.sqrt(z_squared, where=valid), where=valid)
763+
rx_mag[np.logical_not(valid)] = np.inf
761764
# positive and zero sequence magnetising impedance must be equal.
762765
# mag0_percent = z0mag / z0.
763766
checks = {

0 commit comments

Comments
 (0)