diff --git a/pypowsybl/network/impl/perunit.py b/pypowsybl/network/impl/perunit.py index 8b20aefb4..f9af72744 100644 --- a/pypowsybl/network/impl/perunit.py +++ b/pypowsybl/network/impl/perunit.py @@ -48,7 +48,7 @@ def sn(self) -> float: """ The base power, in MW, used for per-uniting """ - return self._network.nominal_apparent_power() + return self._network.nominal_apparent_power def get_buses(self) -> pd.DataFrame: return self._network.get_buses() diff --git a/tests/test_per_unit.py b/tests/test_per_unit.py index c08685b33..ab2f6d71f 100644 --- a/tests/test_per_unit.py +++ b/tests/test_per_unit.py @@ -18,6 +18,7 @@ def test_bus_per_unit(): pp.loadflow.run_ac(n) with pytest.warns(DeprecationWarning, match=re.escape("Per-unit view is deprecated and slow (make a deep copy of the network), use per unit mode of the network instead")): n = per_unit_view(n, 100) + assert n.sn == 100.0 buses = n.get_buses() expected = pd.DataFrame(index=pd.Series(name='id', data=['VLGEN_0', 'VLHV1_0', 'VLHV2_0', 'VLLOAD_0']), columns=['name', 'v_mag', 'v_angle', 'connected_component', 'synchronous_component',