Create tests folder and add test_cases.py to check all cases in pypow…#90
Create tests folder and add test_cases.py to check all cases in pypow…#90dchassin wants to merge 38 commits intorwl:masterfrom
Conversation
|
The current test result is as follows: |
|
This PR now includes needed updates to module versions and changes to tox version info. |
|
Having fun David? It is great to see PYPOWER getting some much needed attention. Sorry I can't work on it with you. In the past Travis-CI was used for CI/CD, but it is no longer free for open source projects. It would be great if the config could be replaced with a GitHub Actions workflow. |
No worries. If you have any thoughts or suggestions on things I should look into, please let me know.
Indeed, I saw that and it is something I've added in this PR. However, I have not connected the tests as a dependency for publishing yet. I'm not sure how to do that across workflows. I think they have to be integrated into a single workflow. |
|
@rwl, I don't see any examples or test cases for DC lines. Do you know how these are modeled? Do you have anything you can point me to that I can use to add a DC line test case? |
|
Tests for |
|
The MATPOWER User's Manual describes the DC line model: |
I assume that means |
This PR adds a
testsfolder, which includes a script to run all the cases found in thepypowerfolder. The tests are part of a github workflow that will be automatically run by github actions anytime there is a push or pull request onmaster. The tests are run on all the supported runners. See GitHub Actions Runners for a list of currently support runners.In principle all these cases should pass both
runpf()andrunopf()calls. If the case name contains the stringtargetit is considered a continuation powerflow and solved usingruncpf().The test script outputs the case data in
case*.jsonand results incase*_pf.outorcase*_opf.outto aid with diagnostics. Thetestsfolder is saved as an artifact when a test fails. Downloading this artifacts can aid in diagnosing the cause of the failure.IMPORTANT NOTE: due to a number of version issues, this PR deprecates support for Python versions older than 3.10, which as of this date are at or very near official end-of-life support.
Case fixes:
case4gs: 'gencost'case9target: runcpf failedcase30pwl: can't multiply sequence by non-int of type 'float'case9Q: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()case30Q: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()New case(s):