Commit 478a0e6
authored
Improve code format & add tests (#246)
* Fix inconsistent indentation in tests
* Fix flake8 warnings in tests
* Add test for ModelicaSystem.setParameters()
This test is currently failing, because getParameters() returns str
instead of float. However, the documentation
https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/ompython.html#simulation
says it should return floats.
* Change test_setParameters to match current behavior
The documentation is wrong, as discussed in
#244
* Add test for ModelicaSystem.setSimulationOptions()
* Fix flake8 warnings in __init__.py
* Fix flake8 warnings in OMTypedParser.py
* Fix flake8 warnings in OMParser/__init__.py
* Remove dependency on future
I don't think this is needed now that python_requires is >=3.8.
* Switch from setup.py to pyproject.toml
pyproject.toml is preferred over setup.py for situations like this:
https://packaging.python.org/en/latest/guides/modernize-setup-py-project/
* Use dependency list from pyproject.toml in CI
* Run flake8 in CI1 parent 5904e4e commit 478a0e6
File tree
17 files changed
+347
-312
lines changed- .github/workflows
- OMPython
- OMParser
- tests
17 files changed
+347
-312
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 35 | | |
41 | 36 | | |
42 | 37 | | |
| |||
207 | 202 | | |
208 | 203 | | |
209 | 204 | | |
210 | | - | |
211 | | - | |
212 | 205 | | |
213 | 206 | | |
214 | 207 | | |
| |||
285 | 278 | | |
286 | 279 | | |
287 | 280 | | |
288 | | - | |
289 | | - | |
290 | 281 | | |
291 | 282 | | |
292 | 283 | | |
| |||
415 | 406 | | |
416 | 407 | | |
417 | 408 | | |
418 | | - | |
419 | 409 | | |
420 | 410 | | |
421 | 411 | | |
| |||
563 | 553 | | |
564 | 554 | | |
565 | 555 | | |
566 | | - | |
567 | 556 | | |
568 | 557 | | |
569 | 558 | | |
| |||
616 | 605 | | |
617 | 606 | | |
618 | 607 | | |
619 | | - | |
620 | 608 | | |
621 | 609 | | |
622 | 610 | | |
| |||
625 | 613 | | |
626 | 614 | | |
627 | 615 | | |
628 | | - | |
629 | 616 | | |
630 | 617 | | |
631 | 618 | | |
| |||
672 | 659 | | |
673 | 660 | | |
674 | 661 | | |
675 | | - | |
676 | 662 | | |
677 | 663 | | |
678 | 664 | | |
| |||
681 | 667 | | |
682 | 668 | | |
683 | 669 | | |
684 | | - | |
685 | 670 | | |
686 | 671 | | |
687 | 672 | | |
688 | 673 | | |
689 | 674 | | |
690 | | - | |
691 | 675 | | |
692 | 676 | | |
693 | 677 | | |
| |||
696 | 680 | | |
697 | 681 | | |
698 | 682 | | |
699 | | - | |
700 | 683 | | |
701 | 684 | | |
702 | 685 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 3 | | |
9 | 4 | | |
10 | 5 | | |
| |||
59 | 54 | | |
60 | 55 | | |
61 | 56 | | |
| 57 | + | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
| |||
75 | 71 | | |
76 | 72 | | |
77 | 73 | | |
78 | | - | |
| 74 | + | |
| 75 | + | |
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
| |||
89 | 86 | | |
90 | 87 | | |
91 | 88 | | |
92 | | - | |
93 | 89 | | |
94 | 90 | | |
95 | 91 | | |
| |||
100 | 96 | | |
101 | 97 | | |
102 | 98 | | |
| 99 | + | |
103 | 100 | | |
104 | 101 | | |
105 | 102 | | |
| |||
123 | 120 | | |
124 | 121 | | |
125 | 122 | | |
126 | | - | |
| 123 | + | |
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
| |||
143 | 140 | | |
144 | 141 | | |
145 | 142 | | |
146 | | - | |
| 143 | + | |
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
| |||
0 commit comments