Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

per-unit-view apparent power crashes #917

Closed
nicow-elia opened this issue Dec 13, 2024 · 3 comments · Fixed by #923
Closed

per-unit-view apparent power crashes #917

nicow-elia opened this issue Dec 13, 2024 · 3 comments · Fixed by #923
Labels
bug Something isn't working

Comments

@nicow-elia
Copy link

nicow-elia commented Dec 13, 2024

Describe the current behavior

net = pypowsybl.network.create_ieee14()
net_pu = pypowsybl.per_unit_view(net)
net.nominal_apparent_power # Works
net_pu.sn # Crashes

Describe the expected behavior

net_pu.sh should return the same as net.nominal_apparent_power

Describe the steps

No response

Environment

pypowsybl 1.8.1

Relevant Log Output


TypeError                                 Traceback (most recent call last)
Cell In[10], line 4
      2 net_pu = pypowsybl.per_unit_view(net)
      3 net.nominal_apparent_power
----> 4 net_pu.sn

File /usr/local/lib/python3.11/site-packages/pypowsybl/network/impl/perunit.py:51, in PerUnitView.sn(self)
     46 @property
     47 def sn(self) -> float:
     48     \"\"\"
     49     The base power, in MW, used for per-uniting
     50     \"\"\"
---> 51     return self._network.nominal_apparent_power()

TypeError: 'int' object is not callable"

Extra Information

No response

@nicow-elia nicow-elia added the bug Something isn't working label Dec 13, 2024
@geofjamg
Copy link
Member

Fixed in #923

@geofjamg
Copy link
Member

geofjamg commented Dec 17, 2024

@nicow-elia be aware that the per-unit view is deprecated and that the right way to do it now is https://powsybl.readthedocs.io/projects/pypowsybl/en/stable/user_guide/per_unit.html#per-unit-data

@jeandemanged jeandemanged linked a pull request Dec 17, 2024 that will close this issue
7 tasks
@nicow-elia
Copy link
Author

Oh I like the change! Thanks for pointing me at that! And thanks for making better docs now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants