rwl / PYPOWER

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

Temcdrm #51

Closed temcdrm closed 6 years ago

temcdrm commented 6 years ago

The December 2017 pull request broke the "pf" and "opf" solutions because some floating point solution values, e.g. bus voltage magnitudes and angles, were truncated to integer. Symptoms include inf and nan loss values, along with per-unit voltages less than 1.000 being truncated to zero. Tested that "pf" and "opf" solutions are giving the same answers as before using the current versions of numpy and scipy, with these changes. What other regression tests should be done? Should there be a test suite?

We have an upcoming release of TESP that depends on this fix to PYPOWER, so please expedite this merge if possible. As we continue to rely on PYPOWER directly, I'm willing to set up a test suite if that would help.

rwl commented 6 years ago

Sorry that #47 wasn't reviewed more closely. It is clearly wrong. We should probably revert the change to printf.py too:

https://github.com/rwl/PYPOWER/pull/47/files#diff-530991037f09461f59b571431c1c7221R150

Ideally, we would test against the results from MATPOWER directly. We could have a MATLAB script that writes out .mat files for each test case. These could then be read using scipy.io:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html

There is already a Travis CI config that shows how to setup MATPOWER to run on GNU Octave:

https://github.com/MATPOWER/matpower/blob/master/.travis.yml

As a collaborator you should have the permissions required to merge this kind of change yourself. I trust you to do that. You should also be able to create new releases:

https://github.com/rwl/PYPOWER/releases/new

The CI/CD pipeline should take care of pushing the new version to PyPI. I'm happy to do it too, but at least you know you are not dependent upon me.