Skip to content

Commit

Permalink
Fix sn property in network per unit view (#923)
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
  • Loading branch information
geofjamg authored Dec 20, 2024
1 parent 9711163 commit 921fad3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pypowsybl/network/impl/perunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions tests/test_per_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 921fad3

Please sign in to comment.