You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse the tutorials and tests for usefull code snippets and examples of use
Reproduced the issue after updating with pip install --upgrade pandapower (or git pull)
Tried basic troubleshooting (if a bug/error) like restarting the interpreter and checking the pythonpath
Reproducible Example
importpandapower.networksaspnimportpandapower.contingencyaspcimportpandapowerasppnet=pn.case30()
# Create a redundant buspp.create_bus(net, vn_kv=135, name="31", index=30, zone="3.0", max_vm_pu=1.05, min_vm_pu=0.95) # create a new buspp.create_switch(net, bus=30, element=29, et="b", type="CB", closed=True) # create a new switch# Try running contingency analysisnminus1_cases= {
"line": {"index": net.line.index.values},
"gen": {"index": net.gen.index.values}
}
# Running contingency analysis here should failpc.run_contingency_ls2g(net, nminus1_cases)
Issue Description and Traceback
When there is a redundant bus, the size of Vinit is not equal to the number of buses anymore.
I had originally reported this in issue#2361 and finally wrote an example that reproduces this behaviour.
Traceback (most recent call last):
File "c:\Users\XXX\Python\pandapower\test_pp_ls2g.py", line 14, in
pc.run_contingency_ls2g(net, nminus1_cases)
File "C:\Users\XXX\anaconda3\envs\pandapower\Lib\site-packages\pandapower\contingency\contingency.py", line 225, in run_contingency_ls2g
s.compute(v_init, net._options["max_iteration"], net._options["tolerance_mva"])
RuntimeError: SecurityAnalysis::compute: Size of the Vinit should be the same as the total number of buses. Currently: Vinit: 30 and there are 31 buses.(fyi: Components of Vinit corresponding to deactivated bus will be ignored anyway, so you can put whatever you want there).
Expected Behavior
run_contingency_ls2g should be able to handle redundant buses e. g. by:
Bug report checklis
Searched the issues page for similar reports
Read the relevant sections of the documentation
Browse the tutorials and tests for usefull code snippets and examples of use
Reproduced the issue after updating with
pip install --upgrade pandapower
(orgit pull
)Tried basic troubleshooting (if a bug/error) like restarting the interpreter and checking the pythonpath
Reproducible Example
Issue Description and Traceback
When there is a redundant bus, the size of Vinit is not equal to the number of buses anymore.
I had originally reported this in issue#2361 and finally wrote an example that reproduces this behaviour.
Traceback (most recent call last):
File "c:\Users\XXX\Python\pandapower\test_pp_ls2g.py", line 14, in
pc.run_contingency_ls2g(net, nminus1_cases)
File "C:\Users\XXX\anaconda3\envs\pandapower\Lib\site-packages\pandapower\contingency\contingency.py", line 225, in run_contingency_ls2g
s.compute(v_init, net._options["max_iteration"], net._options["tolerance_mva"])
RuntimeError: SecurityAnalysis::compute: Size of the Vinit should be the same as the total number of buses. Currently: Vinit: 30 and there are 31 buses.(fyi: Components of Vinit corresponding to deactivated bus will be ignored anyway, so you can put whatever you want there).
Expected Behavior
run_contingency_ls2g should be able to handle redundant buses e. g. by:
Installed Versions
INSTALLED VERSIONS
commit : 0691c5cf90477d3503834d983f69350f250a6ff7
python : 3.12.7
python-bits : 64
OS : Windows
OS-release : 11
Version : 10.0.22631
machine : AMD64
processor : Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : English_Australia.1252
pandas : 2.2.3
numpy : 1.26.4
pytz : 2024.2
dateutil : 2.9.0.post0
pip : 24.3.1
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : None
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.13.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.2
qtpy : None
pyqt5 : None
Label
The text was updated successfully, but these errors were encountered: