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

Cannot printpf with a pf result #4

Closed
hoangluong opened this issue Nov 9, 2012 · 1 comment
Closed

Cannot printpf with a pf result #4

hoangluong opened this issue Nov 9, 2012 · 1 comment

Comments

@hoangluong
Copy link

Hello,

When I tried the source code as in the tutorial http://www.pypower.org/usage.html, I got an error with printpf as follows
In [5]: printpf(r)

Traceback (most recent call last):
File "", line 1, in
File "/ufs/luong/.local/lib/python2.7/site-packages/PYPOWER-4.0.1-py2.7.egg/pypower/printpf.py", line 139, in printpf
i2e = bus[:, BUS_I].astype(int)
TypeError: 'NoneType' object has no attribute 'getitem'

Note that if r is a result returned from a runopf then there is no problem printing it. But if r is a result return from runpf then I got the above error message.

@rwl
Copy link
Owner

rwl commented Nov 9, 2012

The run*() API should be more consistent. runopf returns a single case containing the results. runpf returns a (r, success) tuple that indicates if the problem was solved successfully. Sorry that the documentation is not more clear.

@rwl rwl closed this as completed Nov 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants