ltbams 0.9.9__py3-none-any.whl → 1.0.2a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. ams/__init__.py +4 -11
  2. ams/_version.py +3 -3
  3. ams/cases/5bus/pjm5bus_demo.xlsx +0 -0
  4. ams/cases/5bus/pjm5bus_jumper.xlsx +0 -0
  5. ams/cases/5bus/pjm5bus_uced.json +1062 -0
  6. ams/cases/5bus/pjm5bus_uced.xlsx +0 -0
  7. ams/cases/5bus/pjm5bus_uced_esd1.xlsx +0 -0
  8. ams/cases/5bus/pjm5bus_uced_ev.xlsx +0 -0
  9. ams/cases/ieee123/ieee123.xlsx +0 -0
  10. ams/cases/ieee123/ieee123_regcv1.xlsx +0 -0
  11. ams/cases/ieee14/ieee14.json +1166 -0
  12. ams/cases/ieee14/ieee14.raw +92 -0
  13. ams/cases/ieee14/ieee14_conn.xlsx +0 -0
  14. ams/cases/ieee14/ieee14_uced.xlsx +0 -0
  15. ams/cases/ieee39/ieee39.xlsx +0 -0
  16. ams/cases/ieee39/ieee39_uced.xlsx +0 -0
  17. ams/cases/ieee39/ieee39_uced_esd1.xlsx +0 -0
  18. ams/cases/ieee39/ieee39_uced_pvd1.xlsx +0 -0
  19. ams/cases/ieee39/ieee39_uced_vis.xlsx +0 -0
  20. ams/cases/matpower/benchmark.json +1594 -0
  21. ams/cases/matpower/case118.m +787 -0
  22. ams/cases/matpower/case14.m +129 -0
  23. ams/cases/matpower/case300.m +1315 -0
  24. ams/cases/matpower/case39.m +205 -0
  25. ams/cases/matpower/case5.m +62 -0
  26. ams/cases/matpower/case_ACTIVSg2000.m +9460 -0
  27. ams/cases/npcc/npcc.m +644 -0
  28. ams/cases/npcc/npcc_uced.xlsx +0 -0
  29. ams/cases/pglib/pglib_opf_case39_epri__api.m +243 -0
  30. ams/cases/wecc/wecc.m +714 -0
  31. ams/cases/wecc/wecc_uced.xlsx +0 -0
  32. ams/cli.py +6 -0
  33. ams/core/__init__.py +2 -0
  34. ams/core/documenter.py +652 -0
  35. ams/core/matprocessor.py +782 -0
  36. ams/core/model.py +330 -0
  37. ams/core/param.py +322 -0
  38. ams/core/service.py +918 -0
  39. ams/core/symprocessor.py +224 -0
  40. ams/core/var.py +59 -0
  41. ams/extension/__init__.py +5 -0
  42. ams/extension/eva.py +401 -0
  43. ams/interface.py +1085 -0
  44. ams/io/__init__.py +133 -0
  45. ams/io/json.py +82 -0
  46. ams/io/matpower.py +406 -0
  47. ams/io/psse.py +6 -0
  48. ams/io/pypower.py +103 -0
  49. ams/io/xlsx.py +80 -0
  50. ams/main.py +81 -4
  51. ams/models/__init__.py +24 -0
  52. ams/models/area.py +40 -0
  53. ams/models/bus.py +52 -0
  54. ams/models/cost.py +169 -0
  55. ams/models/distributed/__init__.py +3 -0
  56. ams/models/distributed/esd1.py +71 -0
  57. ams/models/distributed/ev.py +60 -0
  58. ams/models/distributed/pvd1.py +67 -0
  59. ams/models/group.py +231 -0
  60. ams/models/info.py +26 -0
  61. ams/models/line.py +238 -0
  62. ams/models/renewable/__init__.py +5 -0
  63. ams/models/renewable/regc.py +119 -0
  64. ams/models/reserve.py +94 -0
  65. ams/models/shunt.py +14 -0
  66. ams/models/static/__init__.py +2 -0
  67. ams/models/static/gen.py +165 -0
  68. ams/models/static/pq.py +61 -0
  69. ams/models/timeslot.py +69 -0
  70. ams/models/zone.py +49 -0
  71. ams/opt/__init__.py +12 -0
  72. ams/opt/constraint.py +175 -0
  73. ams/opt/exprcalc.py +127 -0
  74. ams/opt/expression.py +188 -0
  75. ams/opt/objective.py +174 -0
  76. ams/opt/omodel.py +432 -0
  77. ams/opt/optzbase.py +192 -0
  78. ams/opt/param.py +156 -0
  79. ams/opt/var.py +233 -0
  80. ams/pypower/__init__.py +8 -0
  81. ams/pypower/_compat.py +9 -0
  82. ams/pypower/core/__init__.py +8 -0
  83. ams/pypower/core/pips.py +894 -0
  84. ams/pypower/core/ppoption.py +244 -0
  85. ams/pypower/core/ppver.py +18 -0
  86. ams/pypower/core/solver.py +2451 -0
  87. ams/pypower/eps.py +6 -0
  88. ams/pypower/idx.py +174 -0
  89. ams/pypower/io.py +604 -0
  90. ams/pypower/make/__init__.py +11 -0
  91. ams/pypower/make/matrices.py +665 -0
  92. ams/pypower/make/pdv.py +506 -0
  93. ams/pypower/routines/__init__.py +7 -0
  94. ams/pypower/routines/cpf.py +513 -0
  95. ams/pypower/routines/cpf_callbacks.py +114 -0
  96. ams/pypower/routines/opf.py +1803 -0
  97. ams/pypower/routines/opffcns.py +1946 -0
  98. ams/pypower/routines/pflow.py +852 -0
  99. ams/pypower/toggle.py +1098 -0
  100. ams/pypower/utils.py +293 -0
  101. ams/report.py +212 -50
  102. ams/routines/__init__.py +23 -0
  103. ams/routines/acopf.py +117 -0
  104. ams/routines/cpf.py +65 -0
  105. ams/routines/dcopf.py +241 -0
  106. ams/routines/dcpf.py +209 -0
  107. ams/routines/dcpf0.py +196 -0
  108. ams/routines/dopf.py +150 -0
  109. ams/routines/ed.py +312 -0
  110. ams/routines/pflow.py +255 -0
  111. ams/routines/pflow0.py +113 -0
  112. ams/routines/routine.py +1033 -0
  113. ams/routines/rted.py +519 -0
  114. ams/routines/type.py +160 -0
  115. ams/routines/uc.py +376 -0
  116. ams/shared.py +63 -9
  117. ams/system.py +61 -22
  118. ams/utils/__init__.py +3 -0
  119. ams/utils/misc.py +77 -0
  120. ams/utils/paths.py +257 -0
  121. docs/Makefile +21 -0
  122. docs/make.bat +35 -0
  123. docs/source/_templates/autosummary/base.rst +5 -0
  124. docs/source/_templates/autosummary/class.rst +35 -0
  125. docs/source/_templates/autosummary/module.rst +65 -0
  126. docs/source/_templates/autosummary/module_toctree.rst +66 -0
  127. docs/source/api.rst +102 -0
  128. docs/source/conf.py +203 -0
  129. docs/source/examples/index.rst +34 -0
  130. docs/source/genmodelref.py +61 -0
  131. docs/source/genroutineref.py +47 -0
  132. docs/source/getting_started/copyright.rst +20 -0
  133. docs/source/getting_started/formats/index.rst +20 -0
  134. docs/source/getting_started/formats/matpower.rst +183 -0
  135. docs/source/getting_started/formats/psse.rst +46 -0
  136. docs/source/getting_started/formats/pypower.rst +223 -0
  137. docs/source/getting_started/formats/xlsx.png +0 -0
  138. docs/source/getting_started/formats/xlsx.rst +23 -0
  139. docs/source/getting_started/index.rst +76 -0
  140. docs/source/getting_started/install.rst +234 -0
  141. docs/source/getting_started/overview.rst +26 -0
  142. docs/source/getting_started/testcase.rst +45 -0
  143. docs/source/getting_started/verification.rst +13 -0
  144. docs/source/images/curent.ico +0 -0
  145. docs/source/images/dcopf_time.png +0 -0
  146. docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png +0 -0
  147. docs/source/images/sponsors/CURENT_Logo_Transparent.png +0 -0
  148. docs/source/images/sponsors/CURENT_Logo_Transparent_Name.png +0 -0
  149. docs/source/images/sponsors/doe.png +0 -0
  150. docs/source/index.rst +108 -0
  151. docs/source/modeling/example.rst +159 -0
  152. docs/source/modeling/index.rst +17 -0
  153. docs/source/modeling/model.rst +210 -0
  154. docs/source/modeling/routine.rst +122 -0
  155. docs/source/modeling/system.rst +51 -0
  156. docs/source/release-notes.rst +398 -0
  157. ltbams-1.0.2a1.dist-info/METADATA +210 -0
  158. ltbams-1.0.2a1.dist-info/RECORD +188 -0
  159. {ltbams-0.9.9.dist-info → ltbams-1.0.2a1.dist-info}/WHEEL +1 -1
  160. ltbams-1.0.2a1.dist-info/top_level.txt +3 -0
  161. tests/__init__.py +0 -0
  162. tests/test_1st_system.py +33 -0
  163. tests/test_addressing.py +40 -0
  164. tests/test_andes_mats.py +61 -0
  165. tests/test_case.py +266 -0
  166. tests/test_cli.py +34 -0
  167. tests/test_export_csv.py +89 -0
  168. tests/test_group.py +83 -0
  169. tests/test_interface.py +216 -0
  170. tests/test_io.py +32 -0
  171. tests/test_jumper.py +27 -0
  172. tests/test_known_good.py +267 -0
  173. tests/test_matp.py +437 -0
  174. tests/test_model.py +54 -0
  175. tests/test_omodel.py +119 -0
  176. tests/test_paths.py +22 -0
  177. tests/test_report.py +251 -0
  178. tests/test_repr.py +21 -0
  179. tests/test_routine.py +178 -0
  180. tests/test_rtn_dcopf.py +101 -0
  181. tests/test_rtn_dcpf.py +77 -0
  182. tests/test_rtn_ed.py +279 -0
  183. tests/test_rtn_pflow.py +219 -0
  184. tests/test_rtn_rted.py +273 -0
  185. tests/test_rtn_uc.py +248 -0
  186. tests/test_service.py +73 -0
  187. ltbams-0.9.9.dist-info/LICENSE +0 -692
  188. ltbams-0.9.9.dist-info/METADATA +0 -859
  189. ltbams-0.9.9.dist-info/RECORD +0 -14
  190. ltbams-0.9.9.dist-info/top_level.txt +0 -1
  191. {ltbams-0.9.9.dist-info → ltbams-1.0.2a1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,188 @@
1
+ ams/__init__.py,sha256=dKIwng8xES4NQHn6ZHy8RCKeXphN9z2wyfmbvniIEg0,351
2
+ ams/__main__.py,sha256=EB4GfGiKgvnQ_psNr0QwPoziYvjmGvQ2yVsBwQtfrLw,170
3
+ ams/_version.py,sha256=KYWVlZmuR5_LFiUY5ldCbtYy6hyWmWkIpRYe4Lpa96c,499
4
+ ams/cli.py,sha256=EyNFXn565gFCppTxpyTZviBdPgUuKtgAPZ4WE6xewRk,6164
5
+ ams/interface.py,sha256=PA_F5KEK7BrSvHjgz3v7vPXH2KEhOerZ7sNLrgT0IcU,44380
6
+ ams/main.py,sha256=wzKLe_BeQAUyFh-U1cxQIOwr-rAJM8ppB3EEi6_v2tw,23607
7
+ ams/report.py,sha256=gUscOYpPjuPuruzIXAADaifIZv2BSjmP1oKCuHdD3Vw,11004
8
+ ams/shared.py,sha256=Zdy4-kHKc0_3CzyZKmGyCvpmrJz4Wzs9qnFlk8eyzq0,4159
9
+ ams/system.py,sha256=PbJE5JPc9_O8cXTC10HPdvlD6MyxuL8z6q9dxKHWtCc,25917
10
+ ams/cases/5bus/pjm5bus_demo.xlsx,sha256=srKTX4AkDRUVg_ygChyrQjeX7o0KKPJ9q9zU69xJqdU,31112
11
+ ams/cases/5bus/pjm5bus_jumper.xlsx,sha256=IfcSZ3V2ZgfFqpaPMBMqitUQMgoxKRnyFyMEtqdeysI,28375
12
+ ams/cases/5bus/pjm5bus_uced.json,sha256=0RvkZwZwzXKqr8y9shjEr3qCPGlrBrh6VpGhvYa4pMM,18256
13
+ ams/cases/5bus/pjm5bus_uced.xlsx,sha256=Fl-k3aXQjyfz8VWFmjH7T4NFfqp3uzBQSZqu1bU_LQg,28196
14
+ ams/cases/5bus/pjm5bus_uced_esd1.xlsx,sha256=I5_GsOBn2wTNSnv7hS1GTJfMqRjYyWCO37WA7GnX0V4,28063
15
+ ams/cases/5bus/pjm5bus_uced_ev.xlsx,sha256=onDf3fMOjVSBGhVOSZtv0FJ3cqMAEUCwxu4sqmr2AQg,29702
16
+ ams/cases/ieee123/ieee123.xlsx,sha256=yWsEFN1BvcoBYX9hWdrenPC_qKQfXtZ4xhpwoIc2OSE,39223
17
+ ams/cases/ieee123/ieee123_regcv1.xlsx,sha256=dIygkiNGzo_RE0moMPFu-9Bt0uPDuAL9zYWAs6e8VSk,41678
18
+ ams/cases/ieee14/ieee14.json,sha256=bBy3i2jKqFNmnc_rmNOYvGm-SAW2T6wwvEQ-Hkj5Hkw,21400
19
+ ams/cases/ieee14/ieee14.raw,sha256=3occlj5Qw42YBVLxONVDIKLTQqHMizHrAfD7Xwzmyec,7935
20
+ ams/cases/ieee14/ieee14_conn.xlsx,sha256=GaaiIsrnS1aX0SRWL2EeCJgRMW9FW1qNoyo4pMZQsw8,19291
21
+ ams/cases/ieee14/ieee14_uced.xlsx,sha256=QeGO6tGiv2gdgJQe6SEiqiwf4hsgKqChgY79Suf04Nc,33043
22
+ ams/cases/ieee39/ieee39.xlsx,sha256=Riz43xQSXi1L-Y9rJbQjuw8oXTnw4W6bGhm--45d-3Q,29465
23
+ ams/cases/ieee39/ieee39_uced.xlsx,sha256=wHz2mUU67VMgxj0v5u0L0Dqy7dhk9yAanOE0_ni4MDQ,41644
24
+ ams/cases/ieee39/ieee39_uced_esd1.xlsx,sha256=Ar-XFwQE_4x2Uo2NKw2fPqveAmcciDS8dDqdAr1tVPM,40797
25
+ ams/cases/ieee39/ieee39_uced_pvd1.xlsx,sha256=X7PhzfqdLOcfPqcGdxA_Tly1jVdIM0QOl4GksYQlK2I,40737
26
+ ams/cases/ieee39/ieee39_uced_vis.xlsx,sha256=P2iKKPpHfieNnNtigCIXNuXgsVumhUs6-au-dVEpaEI,44899
27
+ ams/cases/matpower/benchmark.json,sha256=dAWT8wZZEZpMPj_tIsssubcYIlsE6vTHfXQQKQtKjNo,1205789
28
+ ams/cases/matpower/case118.m,sha256=vC5vIrS553ZXKIXuS1Dk9Ksu4MVXfpEm6G2QbxTEtfc,33696
29
+ ams/cases/matpower/case14.m,sha256=L_xOG3NK5sXpLb5otONgEO1pWku8xNBlx0xPvDn888E,4597
30
+ ams/cases/matpower/case300.m,sha256=L3mWBAncy5pHy53nycEXPmmRh1Rl-ZtlsELXwQGX4S8,65678
31
+ ams/cases/matpower/case39.m,sha256=RAgz-ZjR2HaMYgR32stq_U4D8l85S7DSAFJFE60_3Dw,9628
32
+ ams/cases/matpower/case5.m,sha256=7ZByCJ0IDeveKqAp7YqVSRwxGwj_T0Wte_Bogthv4nk,1921
33
+ ams/cases/matpower/case_ACTIVSg2000.m,sha256=jQBhjej9EL81pZn1nS3uv-zQ2G4o_P9zIZrXxOurhgs,659546
34
+ ams/cases/npcc/npcc.m,sha256=QrYcufKlHrXr5nFC2Z92X05_Q1Rn3Nf11HCCYenAaC0,26342
35
+ ams/cases/npcc/npcc_uced.xlsx,sha256=zuaZEOBwdOHwK5hFgQSXownyH-MfKDZQ-iVFeaFVSyg,86557
36
+ ams/cases/pglib/pglib_opf_case39_epri__api.m,sha256=DKUNon8FgIYKJWOK5ZyQ0fLP0zowNRrf4vmPN-UxU3M,16351
37
+ ams/cases/wecc/wecc.m,sha256=8Wqal6H5r1wNxLLQBCXo2V3v3JZY5IJDEkyrEGCrCWE,30498
38
+ ams/cases/wecc/wecc_uced.xlsx,sha256=R3tZgxEqz_ctKcjA1wwFecxn-QZXutvf7NzgnCg_078,94767
39
+ ams/core/__init__.py,sha256=OUJFLACc9Ggjvzi6DZfmfxrzciRcGtpLTsBfdbOUxGg,80
40
+ ams/core/documenter.py,sha256=FNkpiP65iO809B4Bgmp5C1QeJTQHi-sS9vTP7Wd9D8Q,23131
41
+ ams/core/matprocessor.py,sha256=R3nsA3irZz4cTQMQxE0TXWw9-LucW9PsEMmphA80xns,27608
42
+ ams/core/model.py,sha256=vXLActAi9tLXRCNd5RrEMVWvF0Wt4mwltiRY5CjgrP4,10928
43
+ ams/core/param.py,sha256=LPH48xUHyqWqODD6IsiamUtkJDDSgGCEMAo6vroFoHE,11130
44
+ ams/core/service.py,sha256=bCeBKoVBd42UVGvjP1dU6DpP6LBW5FGWq3bbOHYSlCI,27984
45
+ ams/core/symprocessor.py,sha256=HegjU_UnvWEny9kitI1su9J0WeFDjQnM4gNoeUGJ7qU,8428
46
+ ams/core/var.py,sha256=f48pzir4miBsB5sh6PwUsFe0LdNNEM-d3VufcjbUU0w,1591
47
+ ams/extension/__init__.py,sha256=5IFTNirDL0uDaUsg05_oociVT9VCy2rhPx1ad4LGveM,65
48
+ ams/extension/eva.py,sha256=wUF8RNxzwas2Q6_xD0k3EVWjmX4kxHmTSkv2inJzaUY,16342
49
+ ams/io/__init__.py,sha256=HLE3aozzXEx-6IBy8WTQVdSCpAZrrR9nX6UqaZ7okTw,3774
50
+ ams/io/json.py,sha256=IurwcZDuKczSbRTpcbQZiIi0ARCrMK6kJ0E3wS8ENy8,2585
51
+ ams/io/matpower.py,sha256=40Ga2TPs57Kysm-dirjos-rnZ47aZHMfj7FXpd6eB08,14064
52
+ ams/io/psse.py,sha256=w5VKNE6enX0lfKwPI857PRtdpwN39R6IFRIcdbPSpOg,151
53
+ ams/io/pypower.py,sha256=E6_kSNfv1Yyv9oYfFebeNeKaQPlHyRZQpE8F6Y67g8Q,2583
54
+ ams/io/xlsx.py,sha256=7ATW1seyxsGn7d5p5IuSRFHcoCHVVjMu3E7mP1Mc74U,2460
55
+ ams/models/__init__.py,sha256=Y1Igq3AByDI6QjqjWxNDMeTAa2-fdnk2ZX5HtdJO6lY,703
56
+ ams/models/area.py,sha256=AKYU6aJQKsVWRZdvMO7yic-8wZ1GumSTQXgDg5L0THw,899
57
+ ams/models/bus.py,sha256=U0vSegkm-9fqPQS9KMJQU6gpIMX_1GK5O_dvRc8-0P0,1585
58
+ ams/models/cost.py,sha256=xD_UQCnc4WvVH_sU-JUKi6vgY2h7iFa3cLJZVH4GGx0,5860
59
+ ams/models/group.py,sha256=byAp-sfsS7WhCL8L9y6wqljO6zO_u_JomgIv4syvbJA,5602
60
+ ams/models/info.py,sha256=Oh0Xo5J4ZHBsNIkMOzIwv_DegsX1inyuv3Q5CpCfyQw,788
61
+ ams/models/line.py,sha256=6t0_Y6rlD8riHiljThwluiZMtshu9kgd9ti_Px81KgU,8083
62
+ ams/models/reserve.py,sha256=6sOPBtPklvS2EIUyWwmUZ5XPXzsx-EWTieQp9noa4WM,2817
63
+ ams/models/shunt.py,sha256=h5QV33EcCd86XRR0sMIzcO0PTeTirkWaxi8imPKzOi0,337
64
+ ams/models/timeslot.py,sha256=WKIso2br8K4Ev4_ANzQnuUIYPBgo2LYxAttvez4txKI,1972
65
+ ams/models/zone.py,sha256=b9DsXOsD9Dny-lCMAWwRpRpl7rYVa0ev180YwqFTaiA,1076
66
+ ams/models/distributed/__init__.py,sha256=3uiMHT2YRq79DXIB1jni6wP7dNoQMjU1bMTUpr4P6Rc,161
67
+ ams/models/distributed/esd1.py,sha256=A1qCLzaDtJVI-YoXJd6IRYtP_wp_Ajz2lfjFHvzqHkk,2130
68
+ ams/models/distributed/ev.py,sha256=mpEIGyG9jV1bXkRIXOkCck4hl5np3bfBKvs4ysxukdM,1978
69
+ ams/models/distributed/pvd1.py,sha256=KAOlXpZgT_w58xaGWjm5ht6ksac6eRhaqBFHK4EPRH8,1960
70
+ ams/models/renewable/__init__.py,sha256=7dZyRXbvBAHbLJeJssJ1hsOHj9Bgeg77kB5gcX_mBtg,118
71
+ ams/models/renewable/regc.py,sha256=zoYZWuEWtIPl1rDwveLQdrZlBz1zkfa46xz-dBn8Iys,3683
72
+ ams/models/static/__init__.py,sha256=lh5yR5Xb2unS4ndng-cLU1TAeoidu2s6VAVFLc3HUDU,96
73
+ ams/models/static/gen.py,sha256=CZepvqhjmlGWkUwP3goiimvhZx04L2ADzzx1aVbfdDg,6685
74
+ ams/models/static/pq.py,sha256=Ky6vcc_G7K46azn4-xBJD-6Rht_3y6r7gkSpFNXWIx0,2583
75
+ ams/opt/__init__.py,sha256=INsl8yxtOzTKqV9pzVxlL6RSGDRaUDwxpZMY1QROrF4,459
76
+ ams/opt/constraint.py,sha256=ERT9zwjQyGkvDo465Yd0wBexlIhjVmw0MyWq4BWnWoI,5534
77
+ ams/opt/exprcalc.py,sha256=6g_d4aYEvy9uxikEwhGE6cqL4wElD3KQmtScYSAHW68,3887
78
+ ams/opt/expression.py,sha256=WrWnYliB61uHA_wQjtYgtAXdpgSN1pNqQmWvzHWSsdE,5569
79
+ ams/opt/objective.py,sha256=W0dQfW5dHNdWEc2DQtWYNGMuhMY6Pu-HTD0n7-izDZA,5519
80
+ ams/opt/omodel.py,sha256=hEtfKoSNssSxHgUDdep79pifNTsywytDTjgGgne7nKM,12750
81
+ ams/opt/optzbase.py,sha256=KEYRPhfTCw1E5EUmjpDXSF1kdyqzdR9Yg10Z2VNJahw,5615
82
+ ams/opt/param.py,sha256=r_xxUSxXHNFHwjNSYSyKiQ_IjJtTF_-VG4EuVsL97pg,5131
83
+ ams/opt/var.py,sha256=cpDiELo37E7IoTDlVn_NbkuFNQ88oey23YOF6Gpg6zM,7707
84
+ ams/pypower/__init__.py,sha256=UjASl4jXev2Htwgf2G4FMaAphHqbRhyLYLPpes5B438,247
85
+ ams/pypower/_compat.py,sha256=q2CTtumsE_d-vxK7ju0SzbNnRh5NwrGf_R6J65OStDQ,103
86
+ ams/pypower/eps.py,sha256=1_X3lA8cp0iFDj7WTk37SqDgRarVpr3O1xaMvinQ3rk,66
87
+ ams/pypower/idx.py,sha256=YGEkHdrGDOmF_wHsQzRfDp8blaymJuWb1xErUyCYgD4,8176
88
+ ams/pypower/io.py,sha256=KlXKyErbt2i_UzFJDI4obWbUddQXM3sD4fEtl2ePp7k,26368
89
+ ams/pypower/toggle.py,sha256=7o4vS0fcQXL_Ha8iiMXxnsqAPPPnypnhPcGQ-NXmbO0,50088
90
+ ams/pypower/utils.py,sha256=UOkNNJNs_zHVqcxFUlNG6QiBpqPnDlgSGqhnEXPukvs,8779
91
+ ams/pypower/core/__init__.py,sha256=J4mOfUN6heywauKP99R-Ois2vem5tF6cMS3gsGHSfy8,277
92
+ ams/pypower/core/pips.py,sha256=YD2b3dttyEDhk5Ki9z_KxP3DLg-fJQ-PFovXifLjoxc,32645
93
+ ams/pypower/core/ppoption.py,sha256=pyWqiXtkKNAQNlqxqbUZ3gUoXpthXjafGpJd1vvlVoc,8231
94
+ ams/pypower/core/ppver.py,sha256=J_NX8YfgINQT6FiBG6UxQztfk08lGOOtLk6fce8RVE0,304
95
+ ams/pypower/core/solver.py,sha256=x1Qv_j_Ol7cTJXYh2KNCvP3R9t0HwD3FM_yvT-Vb1W8,84912
96
+ ams/pypower/make/__init__.py,sha256=z-BBqZG4SUzrCAvwwgY5EBf2zsnpS74NWOGGyg_U2ck,494
97
+ ams/pypower/make/matrices.py,sha256=7gFnY_5FdVDFy9XBFVFgPsPFc-XPsPjYJ2y7vkp1uOM,23713
98
+ ams/pypower/make/pdv.py,sha256=0gxiUyh6uoVvv91-td_AZ6-QLBDyD7-km-qkMTWxAiE,18633
99
+ ams/pypower/routines/__init__.py,sha256=D3gkMZBjo6TzGLyMPNjM1TvTSY-9XIlgqUqNoSr_8b0,204
100
+ ams/pypower/routines/cpf.py,sha256=VRL8rWGFaOMn3VheKm2DWZzjpY99W1msvWN4yY9kHcE,17371
101
+ ams/pypower/routines/cpf_callbacks.py,sha256=93f3sdibG7FsXOP9EmqX-iTe0_eZmGtH1JhvtJB1Xig,4480
102
+ ams/pypower/routines/opf.py,sha256=SNklP0cC8qu-ji1vluEj7DjAtvWDneOEkZWZeMBdd5g,73447
103
+ ams/pypower/routines/opffcns.py,sha256=o8EpvWH32x3vbN9gV7Xi-D6RHQ5V2eB8NT15cZrwX2w,78144
104
+ ams/pypower/routines/pflow.py,sha256=q5RFZ5XuB5YQZk1jpJ5aTUB3DfgPJEGsvWyLDNo5PJo,30697
105
+ ams/routines/__init__.py,sha256=hB0Nr9RWjnp7Jx2Xria0JpRyIlbIIDEcLwXHqF9v0ug,612
106
+ ams/routines/acopf.py,sha256=VZC3qs1G7zE--6XxE_wXv432nj3SV5hcrR8967ogYlg,3835
107
+ ams/routines/cpf.py,sha256=xsrUVjtGQ1b7UCXpwwYihqzTeEGJJKnO9LlX1Tz9Tks,1552
108
+ ams/routines/dcopf.py,sha256=cOkqXnSD70QthATeggZUF5c_1tRskzTq2z9ODmsA1JA,10898
109
+ ams/routines/dcpf.py,sha256=SswIb7t37ulxe1rjroA7oSa6z01kYjO-x8P1WWOUutM,8237
110
+ ams/routines/dcpf0.py,sha256=gPPfSUzzJbHz_gAEFVyZ3iriEHvLJ-OGpTzhza8FOkA,6811
111
+ ams/routines/dopf.py,sha256=yIn4tdxgb_phdvlHn4kMT9dUP0c_0Lu5kFfyCAUG-tk,6241
112
+ ams/routines/ed.py,sha256=eNo-edm8qNrQCl9aHqBoIPDF6ltH65L7IobghoK7uH4,11646
113
+ ams/routines/pflow.py,sha256=I4lyXDyprkg_0j3gY5bdkkBA5ImSjnouMzRnuG1yKb8,9435
114
+ ams/routines/pflow0.py,sha256=xocLw94jcl2hh3WwnS_mdUW6dsm3EVjvZptVb814GdE,3521
115
+ ams/routines/routine.py,sha256=QoYxjpItxb7fgPajLoMlGH_TFFgIKgg8Ohhf_WP_SIk,35868
116
+ ams/routines/rted.py,sha256=BWq2XCYP99siBiLNMF0oKiUmxsCAypBPYxTNeCsjz8Y,22197
117
+ ams/routines/type.py,sha256=lvTWSnCYIbRJXIm3HX6jA0Hv-WWYusTOUPfoW8DITlU,3877
118
+ ams/routines/uc.py,sha256=kkYicT1zjD_JmL3HQFe4iBedri1OAHO9-skzjiW21Fc,15625
119
+ ams/utils/__init__.py,sha256=2hAQmWRgmnE-bCGT9cJoW9FkPDMGRiGkbBcUgj-bgjI,122
120
+ ams/utils/misc.py,sha256=Y6tPKpUKJa7bL9alroJuG2UNW9vdQjnfAmKb2EbIls8,2027
121
+ ams/utils/paths.py,sha256=D9VNUwtJtHy-8PFzMnxtQ9HpkOXT6vdVOjfOTuoKGKw,6699
122
+ docs/Makefile,sha256=UKXBFAbKGPt1Xw9J84343v0Mh8ylAZ-tE0uCd74DrQU,725
123
+ docs/make.bat,sha256=9UgKGb4SdP006622fJiFxeFT1BeycYAs6hDbV1xwPy8,804
124
+ docs/source/api.rst,sha256=gDix4Vg_SNUqtijlSmfBktpOrWQMdaj4xsBKrO22dfw,1402
125
+ docs/source/conf.py,sha256=Mh6DMonUOvfw2YyQuhbFz5S-TxQbAgQXa2cQXhZlJBQ,6631
126
+ docs/source/genmodelref.py,sha256=IhmF7bDw8BXPvLD8V3WjQNrfc-H07r5iS-_4DHbbp-8,1420
127
+ docs/source/genroutineref.py,sha256=0JyMc2kV5bWrWbSoO6d7o4QgDgG8mVy3JGGQWacJypw,1064
128
+ docs/source/index.rst,sha256=N5phQS5RIyYs-NZo_5yYB8LjvHzOKLeXzRA-M8i-g3Q,2688
129
+ docs/source/release-notes.rst,sha256=0U7P6i5rAdL3aevH9A9mQXL0Nqn9C_zrs98ca0L-vu8,12592
130
+ docs/source/_templates/autosummary/base.rst,sha256=zl3U4baR4a6YjsHyT-x9zCOrHwKZOVUdWn1NPX2u3bc,106
131
+ docs/source/_templates/autosummary/class.rst,sha256=Hv_igCsLsUpM62_zN0nqj6FSfKnS5xLyu8ZldMbfOAk,668
132
+ docs/source/_templates/autosummary/module.rst,sha256=YdbpCudOrEU-JbuSlzGvcOI2hn_KrCM6FW5HcGqkaEE,1113
133
+ docs/source/_templates/autosummary/module_toctree.rst,sha256=sg30OdqFDLyo8Y3hl9V-s2BXb1bzcjjqqWaWi-C3qFM,1126
134
+ docs/source/examples/index.rst,sha256=u6-pMB5ecSpNb3x1QWC6tJ8ACh3M6MjLBc4CVFf2z_0,876
135
+ docs/source/getting_started/copyright.rst,sha256=XBfWvLm7T8p-zh1jkDy1kODvTDcH73AEV_vkiN32A2o,715
136
+ docs/source/getting_started/index.rst,sha256=mcp1NdUwbPoNzpn7Owf5Qzfd6J_--ToU52PjmrbwjBY,1512
137
+ docs/source/getting_started/install.rst,sha256=YVlKyz1H_TZHWQP1GM0L2gOMg4gj3hwyviYRpVOnxQo,7221
138
+ docs/source/getting_started/overview.rst,sha256=Zy890bDCUVW37NvjhQFUJUae1Zkghr72Az4Qd0PhP_I,1068
139
+ docs/source/getting_started/testcase.rst,sha256=L3fGjfm7mGj7ChRovYw5Jx6OP8PU5pTerid0_Y4iKVM,2016
140
+ docs/source/getting_started/verification.rst,sha256=Jxbgf-SmXYLSokylr1LKtGOjAWUc7a5D-uT_mQZ7i7c,243
141
+ docs/source/getting_started/formats/index.rst,sha256=G3WO-A_B2abKNrxc6dEZ82AhQWSCDMGwQObFvOeKbGo,317
142
+ docs/source/getting_started/formats/matpower.rst,sha256=kyvEoJGsTj1FfVnPoraljPENgiRa3fmB3KqZ_VSJg90,17425
143
+ docs/source/getting_started/formats/psse.rst,sha256=zPHCnMa-M3k3aaDmzoZWXBaR3O0l0zupFlr_yaiB5eU,1570
144
+ docs/source/getting_started/formats/pypower.rst,sha256=7RHy6iC6w37mUIRtHU0oa4fECdkQPEptflUxCwu3nD8,8986
145
+ docs/source/getting_started/formats/xlsx.png,sha256=WX5x7ZG9hBu5Ft8gmA_u4XQewK_SDWw30WOaXsAS8LY,171220
146
+ docs/source/getting_started/formats/xlsx.rst,sha256=utsE0AJirT_P7ZvCk63NhB-z19NdbS8OjWQyQ9juskM,761
147
+ docs/source/images/curent.ico,sha256=pKetB19VTcdXTRH6iACq5YWHZYPcDesd9bfnT2KaaOM,36637
148
+ docs/source/images/dcopf_time.png,sha256=Dy84QWTNeWY2_5uRFQ6RWSaS0yOBqYKYxzwWgE27dkY,196221
149
+ docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png,sha256=0t3hcFcIEdwFWqwCW3xivrpbqHihBlrzq-BjrajQXrA,87680
150
+ docs/source/images/sponsors/CURENT_Logo_Transparent.png,sha256=dCz3400_jBhWG7oJUKJO_Gm4Lejp-hOyFnj60UI2fUI,59336
151
+ docs/source/images/sponsors/CURENT_Logo_Transparent_Name.png,sha256=nIOUmexImq_Ytu7r8ZMTO1wM47wZ_ICHniShnB7JxSc,837476
152
+ docs/source/images/sponsors/doe.png,sha256=2jadi7dnUqJoh2awk525ZiBM8fxOxQOdK_09HiPnKWY,26131
153
+ docs/source/modeling/example.rst,sha256=j8n2bOvT_Mnf5Ce9WkBYc3MiFn7svhG3PGrzRL8OylA,6620
154
+ docs/source/modeling/index.rst,sha256=TasRAJSglc5KAZaGAj9TLMktOO2TtzZsqG5WvvZXB_U,322
155
+ docs/source/modeling/model.rst,sha256=j7OSvoXnDht6rGpgwPiJklsCWrebfx4DxIN-G8r6iFo,7086
156
+ docs/source/modeling/routine.rst,sha256=BkUE3y5L1lA7LP9Nyzc4zzY-tF3t4k7egBE188kybHY,4286
157
+ docs/source/modeling/system.rst,sha256=NMOPNMOKG1_dRyNPPx-MiCKbbpadxWJxGyU6geRUsvQ,1374
158
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
159
+ tests/test_1st_system.py,sha256=5PQgI1DeM5yQTFagOPCMbk0eItTH6-M6FC8TMCv-CRY,1007
160
+ tests/test_addressing.py,sha256=MIT713KCqMg0h2o4rBDZsGUrpGadmMlXnrrdq-wB77E,1364
161
+ tests/test_andes_mats.py,sha256=3JQ2xK5B4s42EHxjCcUjJbt1VY3rZPwjkq81ubFlsLQ,1674
162
+ tests/test_case.py,sha256=uR2bP1g9PO812W9tVmBwWGmyBN5ltMynOZz0ZeI82iE,7808
163
+ tests/test_cli.py,sha256=TtCGBy2e7Ll_2gJTFo9juZtzhaakho_MqkcqhG2w2dk,870
164
+ tests/test_export_csv.py,sha256=rZCafNrVbwDo7ZNC4MrL1gIcrU0c6YVw2q-QGL3O4K4,2921
165
+ tests/test_group.py,sha256=Tq0s9gtenqrv4ws5YNzWxbiF4WgyhtMEAXZfJtew6M4,2699
166
+ tests/test_interface.py,sha256=lXKR8OAsGIg5dV2Uj0UwGAl69hKnc_7EtCYvpP_0rrU,8157
167
+ tests/test_io.py,sha256=ABEtSc7-5aHZZrdVorARRhWIxfSBEzkb5fsiSJluGHA,1087
168
+ tests/test_jumper.py,sha256=bdOknplEGnO_tiJc7p3xQvgTe2b6Dz53bOgbFaXKMAI,537
169
+ tests/test_known_good.py,sha256=NBrlAxnVMxIHXR2cWps-Kwjh36fiU4Y-eupspZkM0ks,9670
170
+ tests/test_matp.py,sha256=LkjhqxSFr6oY_ENpduDQ77rhLLBl6RzIHZ2d0m_8i-8,17262
171
+ tests/test_model.py,sha256=ZgghNYmEeALf8_1sPjq9lIJwuYDQ2SelivJNEYpHxJU,1621
172
+ tests/test_omodel.py,sha256=0hN8_fh_as-ouaZWKBagqMJkjMWCvIjw5o1CgGjiUrU,4305
173
+ tests/test_paths.py,sha256=BU6Tjl4Q_WuHbid0ujkiibqx7yas42YJ7eV_avVMwuw,633
174
+ tests/test_report.py,sha256=B2_ugz5gzF4mDdiba498DrkK9hX4Zfa6KUGW54yCGVE,8069
175
+ tests/test_repr.py,sha256=g7MRdxLcZRI1PlREFdUG_npp0LkcQiJZfOPw1aq0EFM,570
176
+ tests/test_routine.py,sha256=gblLHBQ3DJgYiSGsqGdIGnn-CuEZAEnq9CqhqN5m608,6234
177
+ tests/test_rtn_dcopf.py,sha256=LOfAVFzl2t6oTqTmWhmstu1j9FnpzHxdrplbmb3Y6Mc,3660
178
+ tests/test_rtn_dcpf.py,sha256=QC6F_4LOZ7mrWOEM3s6a6j-eUDM_n49MQouPIR6fzR0,2555
179
+ tests/test_rtn_ed.py,sha256=2CO0kg3LEN8q75_4Z0cgGz4DTOPUjRHur6Dbfw2tRLQ,10173
180
+ tests/test_rtn_pflow.py,sha256=aDL5Ewm6lWqpdHqIIu-DTllhXzt4bMjsLJaKbJa8sXQ,6990
181
+ tests/test_rtn_rted.py,sha256=AyW5B4A51L_nIVLX1eYeu9ZUboOh1CH2FVj2C1XJjSc,9769
182
+ tests/test_rtn_uc.py,sha256=vdG2ss3q91CXLZ2sUgzoUr1NU-63ue7nOxAYywMordE,8286
183
+ tests/test_service.py,sha256=8YIa_PXurwgOzsWvUqoyqS_AzlpdrKHIMxAln5fIqCU,2438
184
+ ltbams-1.0.2a1.dist-info/METADATA,sha256=j57ek2A5JN4QJHjNiJ4osX_4DOboD2QHi2d4iwnIeKE,13068
185
+ ltbams-1.0.2a1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
186
+ ltbams-1.0.2a1.dist-info/entry_points.txt,sha256=FA56FlhO_yVNeEf810SrorVQb7_Xsmo3_EW-W-ijUfA,37
187
+ ltbams-1.0.2a1.dist-info/top_level.txt,sha256=pyKDqG2kj13F9-BYd_wkruRdBSqLXw8Nwc-cmljqrxg,15
188
+ ltbams-1.0.2a1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,3 @@
1
+ ams
2
+ docs
3
+ tests
tests/__init__.py ADDED
File without changes
@@ -0,0 +1,33 @@
1
+ import unittest
2
+
3
+ import ams
4
+
5
+
6
+ class TestCodegen(unittest.TestCase):
7
+ """
8
+ Test code generation.
9
+ """
10
+
11
+ def test_1_docs(self) -> None:
12
+ sp = ams.system.System()
13
+ out = ''
14
+ for tp in sp.types.values():
15
+ out += tp.doc_all()
16
+
17
+ out = ''
18
+ for group in sp.groups.values():
19
+ out += group.doc_all()
20
+
21
+ def test_docum(self) -> None:
22
+ sp = ams.load(ams.get_case('5bus/pjm5bus_demo.xlsx'),
23
+ setup=True, no_output=True)
24
+ sp.DCOPF.init()
25
+ docum = sp.DCOPF.docum
26
+ for export in ['plain', 'rest']:
27
+ docum._obj_doc(max_width=78, export=export)
28
+ docum._constr_doc(max_width=78, export=export)
29
+ docum._exprc_doc(max_width=78, export=export)
30
+ docum._var_doc(max_width=78, export=export)
31
+ docum._service_doc(max_width=78, export=export)
32
+ docum._param_doc(max_width=78, export=export)
33
+ docum.config.doc(max_width=78, export=export)
@@ -0,0 +1,40 @@
1
+ import unittest
2
+ import numpy as np
3
+
4
+ import ams
5
+
6
+ ams.config_logger(stream_level=40)
7
+
8
+
9
+ class TestAddressing(unittest.TestCase):
10
+ """
11
+ Tests for addressing.
12
+ """
13
+
14
+ def test_ieee14_address(self):
15
+ """
16
+ Test IEEE14 address.
17
+ """
18
+
19
+ # FIXME: why there will be case parsing information using ams.system.example()?
20
+ ss = ams.system.example()
21
+
22
+ # bus variable indices (internal)
23
+ np.testing.assert_array_equal(ss.Bus.a.a,
24
+ np.arange(0, ss.Bus.n, 1))
25
+ np.testing.assert_array_equal(ss.Bus.v.a,
26
+ np.arange(ss.Bus.n, 2*ss.Bus.n, 1))
27
+
28
+ # external variable indices
29
+ np.testing.assert_array_equal(ss.PV.ud.a,
30
+ np.array([31, 32, 33, 34]))
31
+ np.testing.assert_array_equal(ss.PV.p.a,
32
+ np.array([35, 36, 37, 38]))
33
+ np.testing.assert_array_equal(ss.PV.q.a,
34
+ np.array([39, 40, 41, 42]))
35
+ np.testing.assert_array_equal(ss.Slack.ud.a,
36
+ np.array([28]))
37
+ np.testing.assert_array_equal(ss.Slack.p.a,
38
+ np.array([29]))
39
+ np.testing.assert_array_equal(ss.Slack.q.a,
40
+ np.array([30]))
@@ -0,0 +1,61 @@
1
+ """
2
+ Test ANDES matrices.
3
+ """
4
+
5
+ import unittest
6
+ import numpy as np
7
+ import importlib.metadata
8
+ from packaging.version import parse as parse_version
9
+
10
+ import ams
11
+
12
+
13
+ class TestMatrices(unittest.TestCase):
14
+ """
15
+ Tests for system matrices consistency.
16
+ """
17
+
18
+ andes_version = importlib.metadata.version("andes")
19
+ if parse_version(andes_version) < parse_version('1.9.2'):
20
+ raise unittest.SkipTest("Requires ANDES version >= 1.9.2")
21
+
22
+ sp = ams.load(ams.get_case('5bus/pjm5bus_demo.xlsx'),
23
+ setup=True, no_output=True, default_config=True,)
24
+ sa = sp.to_andes(setup=True, no_output=True, default_config=True,)
25
+
26
+ def setUp(self) -> None:
27
+ """
28
+ Test setup.
29
+ """
30
+
31
+ def test_build_y(self):
32
+ """
33
+ Test build_y consistency.
34
+ """
35
+ ysp = self.sp.Line.build_y()
36
+ ysa = self.sa.Line.build_y()
37
+ np.testing.assert_equal(np.array(ysp.V), np.array(ysa.V))
38
+
39
+ def test_build_Bp(self):
40
+ """
41
+ Test build_Bp consistency.
42
+ """
43
+ Bp_sp = self.sp.Line.build_Bp()
44
+ Bp_sa = self.sa.Line.build_Bp()
45
+ np.testing.assert_equal(np.array(Bp_sp.V), np.array(Bp_sa.V))
46
+
47
+ def test_build_Bpp(self):
48
+ """
49
+ Test build_Bpp consistency.
50
+ """
51
+ Bpp_sp = self.sp.Line.build_Bpp()
52
+ Bpp_sa = self.sa.Line.build_Bpp()
53
+ np.testing.assert_equal(np.array(Bpp_sp.V), np.array(Bpp_sa.V))
54
+
55
+ def test_build_Bdc(self):
56
+ """
57
+ Test build_Bdc consistency.
58
+ """
59
+ Bdc_sp = self.sp.Line.build_Bdc()
60
+ Bdc_sa = self.sa.Line.build_Bdc()
61
+ np.testing.assert_equal(np.array(Bdc_sp.V), np.array(Bdc_sa.V))
tests/test_case.py ADDED
@@ -0,0 +1,266 @@
1
+ import os
2
+ import unittest
3
+
4
+ import numpy as np
5
+
6
+ import ams
7
+ from ams.utils.paths import get_case
8
+
9
+
10
+ class Test5Bus(unittest.TestCase):
11
+ """
12
+ Tests for the 5-bus system.
13
+ """
14
+
15
+ def setUp(self) -> None:
16
+ self.ss = ams.main.load(
17
+ get_case("5bus/pjm5bus_uced.xlsx"),
18
+ default_config=True,
19
+ no_output=True,
20
+ )
21
+
22
+ def test_essential(self):
23
+ """
24
+ Test essential functionalities of Model and System.
25
+ """
26
+
27
+ # --- test model names
28
+ self.assertTrue("Bus" in self.ss.models)
29
+ self.assertTrue("PQ" in self.ss.models)
30
+
31
+ # --- test device counts
32
+ self.assertEqual(self.ss.Bus.n, 5)
33
+ self.assertEqual(self.ss.PQ.n, 3)
34
+ self.assertEqual(self.ss.PV.n, 3)
35
+ self.assertEqual(self.ss.Slack.n, 1)
36
+ self.assertEqual(self.ss.Line.n, 7)
37
+ self.assertEqual(self.ss.Zone.n, 2)
38
+ self.assertEqual(self.ss.SFR.n, 2)
39
+ self.assertEqual(self.ss.SR.n, 2)
40
+ self.assertEqual(self.ss.NSR.n, 2)
41
+ self.assertEqual(self.ss.GCost.n, 4)
42
+ self.assertEqual(self.ss.SFRCost.n, 4)
43
+ self.assertEqual(self.ss.SRCost.n, 4)
44
+ self.assertEqual(self.ss.NSRCost.n, 4)
45
+ self.assertEqual(self.ss.EDTSlot.n, 24)
46
+ self.assertEqual(self.ss.UCTSlot.n, 24)
47
+
48
+ # test idx values
49
+ self.assertSequenceEqual(self.ss.Bus.idx.v, ['Bus_1', 'Bus_2', 'Bus_3', 'Bus_4', 'Bus_5'])
50
+ self.assertSequenceEqual(self.ss.Area.idx.v, [1, 2, 3])
51
+
52
+ # test cache refreshing
53
+ self.ss.Bus.cache.refresh() # used in ANDES but not in AMS
54
+
55
+ # test conversion to dataframe
56
+ self.ss.Bus.as_df()
57
+ self.ss.Bus.as_df(vin=True)
58
+
59
+ # test conversion to dataframe of ``Horizon`` model
60
+ self.ss.EDTSlot.as_df()
61
+ self.ss.EDTSlot.as_df(vin=True)
62
+
63
+ self.ss.UCTSlot.as_df()
64
+ self.ss.UCTSlot.as_df(vin=True)
65
+
66
+ def test_pflow_reset(self):
67
+ """
68
+ Test resetting power flow.
69
+ """
70
+
71
+ self.ss.PFlow.run()
72
+ self.ss.reset()
73
+ self.ss.PFlow.run()
74
+
75
+ def test_alter_param(self):
76
+ """
77
+ Test altering parameter for power flow.
78
+ """
79
+
80
+ self.ss.PV.alter("v0", "PV_3", 0.98)
81
+ self.assertEqual(self.ss.PV.v0.v[1], 0.98)
82
+ self.ss.PFlow.run()
83
+
84
+ def test_alter_param_before_routine(self):
85
+ """
86
+ Test altering parameter before running routine.
87
+ """
88
+
89
+ self.ss.GCost.alter("c1", ['GCost_1', 'GCost_2'], [1500., 3100.])
90
+ np.testing.assert_array_equal(self.ss.GCost.c1.v, [1500., 3100., 0.4, 0.1])
91
+ self.ss.ACOPF.run()
92
+ np.testing.assert_array_equal(self.ss.GCost.c1.v, [1500., 3100., 0.4, 0.1])
93
+
94
+ def test_alter_param_after_routine(self):
95
+ """
96
+ Test altering parameter after running routine.
97
+ """
98
+
99
+ self.ss.ACOPF.run()
100
+ self.ss.GCost.alter("c1", ['GCost_1', 'GCost_2'], [1500., 3100.])
101
+ np.testing.assert_array_equal(self.ss.GCost.c1.v, [1500., 3100., 0.4, 0.1])
102
+ self.ss.ACOPF.run()
103
+ np.testing.assert_array_equal(self.ss.GCost.c1.v, [1500., 3100., 0.4, 0.1])
104
+
105
+ def test_multiple_disconnected_line(self):
106
+ """
107
+ Test connectivity check for systems with disconnected lines.
108
+
109
+ These disconnected lines (zeros) was not excluded when counting
110
+ connected buses, causing an out-of-bound error.
111
+ """
112
+ # TODO: need to add `connectivity` in `system`
113
+ pass
114
+ # self.ss.Line.u.v[[0, 6]] = 0
115
+ # self.ss.PFlow.run()
116
+ # self.assertEqual(len(self.ss.Bus.islands), 1)
117
+ # self.assertEqual(self.ss.Bus.n_islanded_buses, 0)
118
+
119
+
120
+ class TestIEEE14RAW(unittest.TestCase):
121
+ """
122
+ Test IEEE14 system in the RAW format.
123
+ """
124
+
125
+ # TODO: after add `run` in `system`, improve this part
126
+ def test_ieee14_raw(self):
127
+ ss = ams.load(
128
+ get_case("ieee14/ieee14.raw"),
129
+ default_config=True,
130
+ no_output=True,
131
+ )
132
+ ss.PFlow.run()
133
+ self.assertEqual(ss.PFlow.exit_code, 0, "Exit code is not 0.")
134
+
135
+ def test_ieee14_raw_convert(self):
136
+ ss = ams.run(
137
+ get_case("ieee14/ieee14.raw"),
138
+ convert=True,
139
+ default_config=True,
140
+ )
141
+ os.remove(ss.files.dump)
142
+ self.assertEqual(ss.exit_code, 0, "Exit code is not 0.")
143
+
144
+ def test_ieee14_raw2xlsx(self):
145
+ ss = ams.load(
146
+ get_case("ieee14/ieee14.raw"),
147
+ setup=True,
148
+ no_output=True,
149
+ default_config=True,
150
+ )
151
+ ams.io.xlsx.write(ss, "ieee14.xlsx", overwrite=True)
152
+ self.assertTrue(os.path.exists("ieee14.xlsx"))
153
+ os.remove("ieee14.xlsx")
154
+
155
+ def test_ieee14_raw2json(self):
156
+ ss = ams.load(
157
+ get_case("ieee14/ieee14.raw"),
158
+ setup=True,
159
+ no_output=True,
160
+ default_config=True,
161
+ )
162
+ ams.io.json.write(ss, "ieee14.json", overwrite=True)
163
+ self.assertTrue(os.path.exists("ieee14.json"))
164
+ os.remove("ieee14.json")
165
+
166
+ def test_ieee14_raw2json_convert(self):
167
+ ss = ams.run(
168
+ get_case("ieee14/ieee14.raw"),
169
+ convert="json",
170
+ default_config=True,
171
+ )
172
+
173
+ ss2 = ams.run(
174
+ "ieee14.json",
175
+ default_config=True,
176
+ no_output=True,
177
+ )
178
+
179
+ os.remove(ss.files.dump)
180
+ self.assertEqual(ss2.exit_code, 0, "Exit code is not 0.")
181
+
182
+ def test_read_json_from_memory(self):
183
+ fd = open(get_case("ieee14/ieee14.json"), "r")
184
+
185
+ ss = ams.main.System(
186
+ default_config=True,
187
+ no_output=True,
188
+ )
189
+ ams.io.json.read(ss, fd)
190
+ ss.setup()
191
+ ss.PFlow.run()
192
+
193
+ fd.close()
194
+ self.assertEqual(ss.exit_code, 0, "Exit code is not 0.")
195
+
196
+ def test_read_mpc_from_memory(self):
197
+ fd = open(get_case("matpower/case14.m"), "r")
198
+
199
+ ss = ams.main.System(
200
+ default_config=True,
201
+ no_output=True,
202
+ )
203
+ ams.io.matpower.read(ss, fd)
204
+ ss.setup()
205
+ ss.PFlow.run()
206
+
207
+ fd.close()
208
+ self.assertEqual(ss.exit_code, 0, "Exit code is not 0.")
209
+
210
+ def test_read_psse_from_memory(self):
211
+ fd_raw = open(get_case("ieee14/ieee14.raw"), "r")
212
+
213
+ ss = ams.main.System(
214
+ default_config=True,
215
+ no_output=True,
216
+ )
217
+ # suppress out-of-normal info
218
+ ss.config.warn_limits = 0
219
+ ss.config.warn_abnormal = 0
220
+
221
+ ams.io.psse.read(ss, fd_raw)
222
+ ss.setup()
223
+ ss.PFlow.run()
224
+
225
+ fd_raw.close()
226
+ self.assertEqual(ss.exit_code, 0, "Exit code is not 0.")
227
+
228
+
229
+ class TestCaseInit(unittest.TestCase):
230
+ """
231
+ Test if initializations pass.
232
+ """
233
+
234
+ def test_ieee39_init(self):
235
+ """
236
+ Test if ieee39 initialization works.
237
+ """
238
+ ss = ams.load(
239
+ get_case("ieee39/ieee39_uced.xlsx"),
240
+ default_config=True,
241
+ no_output=True,
242
+ )
243
+ ss.DCOPF.init()
244
+ ss.RTED.init()
245
+ ss.ED.init()
246
+ ss.UC.init()
247
+
248
+ self.assertEqual(ss.DCOPF.exit_code, 0, "Exit code is not 0.")
249
+ self.assertEqual(ss.RTED.exit_code, 0, "Exit code is not 0.")
250
+ self.assertEqual(ss.ED.exit_code, 0, "Exit code is not 0.")
251
+ self.assertEqual(ss.UC.exit_code, 0, "Exit code is not 0.")
252
+
253
+ def test_ieee39_esd1_init(self):
254
+ """
255
+ Test if ieee39 with ESD1 initialization works.
256
+ """
257
+ ss = ams.load(
258
+ get_case("ieee39/ieee39_uced_esd1.xlsx"),
259
+ default_config=True,
260
+ no_output=True,
261
+ )
262
+ ss.EDES.init()
263
+ ss.UCES.init()
264
+
265
+ self.assertEqual(ss.EDES.exit_code, 0, "Exit code is not 0.")
266
+ self.assertEqual(ss.UCES.exit_code, 0, "Exit code is not 0.")
tests/test_cli.py ADDED
@@ -0,0 +1,34 @@
1
+ import unittest
2
+ import os
3
+
4
+ import ams.main
5
+ import ams.cli
6
+
7
+
8
+ class TestCLI(unittest.TestCase):
9
+
10
+ def test_cli_parser(self):
11
+ ams.cli.create_parser()
12
+
13
+ def test_cli_preamble(self):
14
+ ams.cli.preamble()
15
+
16
+ def test_main_doc(self):
17
+ ams.main.doc('Bus')
18
+ ams.main.doc(list_supported=True)
19
+
20
+ def test_versioninfo(self):
21
+ ams.main.versioninfo()
22
+
23
+ def test_misc(self):
24
+ ams.main.misc(show_license=True)
25
+ ams.main.misc(save_config=None, overwrite=True)
26
+
27
+ def test_profile_run(self):
28
+ _ = ams.main.run(ams.get_case('matpower/case5.m'),
29
+ no_output=False,
30
+ profile=True,)
31
+ self.assertTrue(os.path.exists('case5_prof.prof'))
32
+ self.assertTrue(os.path.exists('case5_prof.txt'))
33
+ os.remove('case5_prof.prof')
34
+ os.remove('case5_prof.txt')