rwl / PYPOWER

Port of MATPOWER to Python
http://rwl.github.io/PYPOWER/api/
Other
329 stars 110 forks source link

pf not found #42

Open rabi01 opened 7 years ago

rabi01 commented 7 years ago

I installed PYPOWER along with numpy and scipy using pip install, and after that I tried running pf -h and I got the error Traceback (most recent call last): File "<pyshell#18>", line 1, in pf -h NameError: name 'pf' is not defined.

Even I tried to used runpf(ppe) by loading the case9 into ppe, and I got the error. My code from pypower.api import case9, ppoption,runpf,printpf ppc = case9()

ppopt = ppoption(PF_ALG=2)

r = runpf(ppc) printpf(r)

error: Traceback (most recent call last): File "C:\Python27\test.py", line 4, in r = runpf(ppc) File "C:\Python27-64\lib\site-packages\pypower\runpf.py", line 95, in runpf ppc = ext2int(ppc) File "C:\Python27-64\lib\site-packages\pypower\ext2int.py", line 152, in ext2int o["bus"]["e2i"] = zeros(max(o["bus"]["i2e"]) + 1) TypeError: 'numpy.float64' object cannot be interpreted as an index.

Please help. Thanks in advance