ltbams 0.9.11__tar.gz → 0.9.12__tar.gz

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 (205) hide show
  1. ltbams-0.9.12/PKG-INFO +173 -0
  2. {ltbams-0.9.11 → ltbams-0.9.12}/README.md +7 -2
  3. {ltbams-0.9.11 → ltbams-0.9.12}/ams/__init__.py +2 -1
  4. {ltbams-0.9.11 → ltbams-0.9.12}/ams/_version.py +3 -3
  5. {ltbams-0.9.11 → ltbams-0.9.12}/ams/core/documenter.py +74 -6
  6. {ltbams-0.9.11 → ltbams-0.9.12}/ams/core/matprocessor.py +4 -2
  7. {ltbams-0.9.11 → ltbams-0.9.12}/ams/core/param.py +1 -1
  8. {ltbams-0.9.11 → ltbams-0.9.12}/ams/core/service.py +44 -24
  9. {ltbams-0.9.11 → ltbams-0.9.12}/ams/core/symprocessor.py +11 -3
  10. {ltbams-0.9.11 → ltbams-0.9.12}/ams/interface.py +60 -12
  11. {ltbams-0.9.11 → ltbams-0.9.12}/ams/main.py +4 -2
  12. ltbams-0.9.12/ams/opt/__init__.py +12 -0
  13. ltbams-0.9.12/ams/opt/constraint.py +172 -0
  14. ltbams-0.9.12/ams/opt/exprcalc.py +139 -0
  15. ltbams-0.9.12/ams/opt/expression.py +200 -0
  16. ltbams-0.9.12/ams/opt/objective.py +174 -0
  17. ltbams-0.9.12/ams/opt/omodel.py +432 -0
  18. ltbams-0.9.12/ams/opt/optbase.py +155 -0
  19. ltbams-0.9.12/ams/opt/param.py +156 -0
  20. ltbams-0.9.12/ams/opt/var.py +245 -0
  21. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/routines/opf.py +1 -1
  22. {ltbams-0.9.11 → ltbams-0.9.12}/ams/report.py +15 -4
  23. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/__init__.py +2 -0
  24. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/acopf.py +4 -4
  25. ltbams-0.9.12/ams/routines/dcopf.py +194 -0
  26. ltbams-0.9.12/ams/routines/dcpf.py +205 -0
  27. ltbams-0.9.11/ams/routines/dcpf.py → ltbams-0.9.12/ams/routines/dcpf0.py +5 -3
  28. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/dopf.py +1 -1
  29. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/ed.py +8 -8
  30. ltbams-0.9.12/ams/routines/pflow.py +255 -0
  31. ltbams-0.9.11/ams/routines/pflow.py → ltbams-0.9.12/ams/routines/pflow0.py +7 -5
  32. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/routine.py +21 -16
  33. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/rted.py +4 -4
  34. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/uc.py +7 -7
  35. {ltbams-0.9.11 → ltbams-0.9.12}/ams/shared.py +6 -4
  36. {ltbams-0.9.11 → ltbams-0.9.12}/ams/system.py +13 -4
  37. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/examples/index.rst +2 -1
  38. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/release-notes.rst +58 -36
  39. ltbams-0.9.12/ltbams.egg-info/PKG-INFO +173 -0
  40. {ltbams-0.9.11 → ltbams-0.9.12}/ltbams.egg-info/SOURCES.txt +12 -0
  41. ltbams-0.9.12/ltbams.egg-info/entry_points.txt +3 -0
  42. ltbams-0.9.12/ltbams.egg-info/requires.txt +95 -0
  43. {ltbams-0.9.11 → ltbams-0.9.12}/requirements.txt +1 -0
  44. ltbams-0.9.12/setup.py +108 -0
  45. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_1st_system.py +1 -1
  46. ltbams-0.9.12/tests/test_cli.py +34 -0
  47. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_interop.py +1 -3
  48. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_known_good.py +4 -2
  49. ltbams-0.9.12/tests/test_omodel.py +119 -0
  50. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_rtn_rted.py +1 -1
  51. ltbams-0.9.11/PKG-INFO +0 -11
  52. ltbams-0.9.11/ams/opt/__init__.py +0 -5
  53. ltbams-0.9.11/ams/opt/omodel.py +0 -1223
  54. ltbams-0.9.11/ams/routines/dcopf.py +0 -381
  55. ltbams-0.9.11/ltbams.egg-info/PKG-INFO +0 -11
  56. ltbams-0.9.11/setup.py +0 -17
  57. ltbams-0.9.11/tests/test_cli.py +0 -13
  58. {ltbams-0.9.11 → ltbams-0.9.12}/CONTRIBUTING.rst +0 -0
  59. {ltbams-0.9.11 → ltbams-0.9.12}/LICENSE +0 -0
  60. {ltbams-0.9.11 → ltbams-0.9.12}/MANIFEST.in +0 -0
  61. {ltbams-0.9.11 → ltbams-0.9.12}/ams/__main__.py +0 -0
  62. {ltbams-0.9.11 → ltbams-0.9.12}/ams/benchmarks.py +0 -0
  63. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/5bus/pjm5bus_demo.xlsx +0 -0
  64. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/5bus/pjm5bus_jumper.xlsx +0 -0
  65. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/5bus/pjm5bus_uced.json +0 -0
  66. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/5bus/pjm5bus_uced.xlsx +0 -0
  67. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/5bus/pjm5bus_uced_esd1.xlsx +0 -0
  68. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/5bus/pjm5bus_uced_ev.xlsx +0 -0
  69. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee123/ieee123.xlsx +0 -0
  70. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee123/ieee123_regcv1.xlsx +0 -0
  71. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee14/ieee14.json +0 -0
  72. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee14/ieee14.raw +0 -0
  73. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee14/ieee14_uced.xlsx +0 -0
  74. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee39/ieee39.xlsx +0 -0
  75. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee39/ieee39_uced.xlsx +0 -0
  76. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee39/ieee39_uced_esd1.xlsx +0 -0
  77. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee39/ieee39_uced_pvd1.xlsx +0 -0
  78. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/ieee39/ieee39_uced_vis.xlsx +0 -0
  79. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/matpower/benchmark.json +0 -0
  80. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/matpower/case118.m +0 -0
  81. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/matpower/case14.m +0 -0
  82. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/matpower/case300.m +0 -0
  83. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/matpower/case39.m +0 -0
  84. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/matpower/case5.m +0 -0
  85. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/matpower/case_ACTIVSg2000.m +0 -0
  86. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/npcc/npcc.m +0 -0
  87. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/npcc/npcc_uced.xlsx +0 -0
  88. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/pglib/pglib_opf_case39_epri__api.m +0 -0
  89. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/wecc/wecc.m +0 -0
  90. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cases/wecc/wecc_uced.xlsx +0 -0
  91. {ltbams-0.9.11 → ltbams-0.9.12}/ams/cli.py +0 -0
  92. {ltbams-0.9.11 → ltbams-0.9.12}/ams/core/__init__.py +0 -0
  93. {ltbams-0.9.11 → ltbams-0.9.12}/ams/core/model.py +0 -0
  94. {ltbams-0.9.11 → ltbams-0.9.12}/ams/core/var.py +0 -0
  95. {ltbams-0.9.11 → ltbams-0.9.12}/ams/extension/__init__.py +0 -0
  96. {ltbams-0.9.11 → ltbams-0.9.12}/ams/extension/eva.py +0 -0
  97. {ltbams-0.9.11 → ltbams-0.9.12}/ams/io/__init__.py +0 -0
  98. {ltbams-0.9.11 → ltbams-0.9.12}/ams/io/json.py +0 -0
  99. {ltbams-0.9.11 → ltbams-0.9.12}/ams/io/matpower.py +0 -0
  100. {ltbams-0.9.11 → ltbams-0.9.12}/ams/io/psse.py +0 -0
  101. {ltbams-0.9.11 → ltbams-0.9.12}/ams/io/pypower.py +0 -0
  102. {ltbams-0.9.11 → ltbams-0.9.12}/ams/io/xlsx.py +0 -0
  103. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/__init__.py +0 -0
  104. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/area.py +0 -0
  105. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/bus.py +0 -0
  106. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/cost.py +0 -0
  107. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/distributed/__init__.py +0 -0
  108. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/distributed/esd1.py +0 -0
  109. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/distributed/ev.py +0 -0
  110. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/distributed/pvd1.py +0 -0
  111. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/group.py +0 -0
  112. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/info.py +0 -0
  113. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/line.py +0 -0
  114. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/region.py +0 -0
  115. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/renewable/__init__.py +0 -0
  116. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/renewable/regc.py +0 -0
  117. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/reserve.py +0 -0
  118. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/shunt.py +0 -0
  119. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/static/__init__.py +0 -0
  120. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/static/gen.py +0 -0
  121. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/static/pq.py +0 -0
  122. {ltbams-0.9.11 → ltbams-0.9.12}/ams/models/timeslot.py +0 -0
  123. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/__init__.py +0 -0
  124. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/_compat.py +0 -0
  125. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/core/__init__.py +0 -0
  126. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/core/pips.py +0 -0
  127. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/core/ppoption.py +0 -0
  128. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/core/ppver.py +0 -0
  129. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/core/solver.py +0 -0
  130. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/eps.py +0 -0
  131. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/idx.py +0 -0
  132. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/io.py +0 -0
  133. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/make/__init__.py +0 -0
  134. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/make/matrices.py +0 -0
  135. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/make/pdv.py +0 -0
  136. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/routines/__init__.py +0 -0
  137. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/routines/cpf.py +0 -0
  138. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/routines/cpf_callbacks.py +0 -0
  139. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/routines/opffcns.py +0 -0
  140. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/routines/pflow.py +0 -0
  141. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/toggle.py +0 -0
  142. {ltbams-0.9.11 → ltbams-0.9.12}/ams/pypower/utils.py +0 -0
  143. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/cpf.py +0 -0
  144. {ltbams-0.9.11 → ltbams-0.9.12}/ams/routines/type.py +0 -0
  145. {ltbams-0.9.11 → ltbams-0.9.12}/ams/utils/__init__.py +0 -0
  146. {ltbams-0.9.11 → ltbams-0.9.12}/ams/utils/paths.py +0 -0
  147. {ltbams-0.9.11 → ltbams-0.9.12}/docs/Makefile +0 -0
  148. {ltbams-0.9.11 → ltbams-0.9.12}/docs/make.bat +0 -0
  149. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/_templates/autosummary/base.rst +0 -0
  150. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/_templates/autosummary/class.rst +0 -0
  151. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/_templates/autosummary/module.rst +0 -0
  152. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/_templates/autosummary/module_toctree.rst +0 -0
  153. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/api.rst +0 -0
  154. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/conf.py +0 -0
  155. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/genmodelref.py +0 -0
  156. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/genroutineref.py +0 -0
  157. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/copyright.rst +0 -0
  158. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/formats/index.rst +0 -0
  159. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/formats/matpower.rst +0 -0
  160. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/formats/psse.rst +0 -0
  161. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/formats/pypower.rst +0 -0
  162. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/formats/xlsx.png +0 -0
  163. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/formats/xlsx.rst +0 -0
  164. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/index.rst +0 -0
  165. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/install.rst +0 -0
  166. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/overview.rst +0 -0
  167. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/testcase.rst +0 -0
  168. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/getting_started/verification.rst +0 -0
  169. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/images/dcopf_time.png +0 -0
  170. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png +0 -0
  171. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/images/sponsors/CURENT_Logo_Transparent.png +0 -0
  172. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/images/sponsors/CURENT_Logo_Transparent_Name.png +0 -0
  173. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/images/sponsors/doe.png +0 -0
  174. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/index.rst +0 -0
  175. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/modeling/example.rst +0 -0
  176. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/modeling/index.rst +0 -0
  177. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/modeling/model.rst +0 -0
  178. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/modeling/routine.rst +0 -0
  179. {ltbams-0.9.11 → ltbams-0.9.12}/docs/source/modeling/system.rst +0 -0
  180. {ltbams-0.9.11 → ltbams-0.9.12}/ltbams.egg-info/dependency_links.txt +0 -0
  181. {ltbams-0.9.11 → ltbams-0.9.12}/ltbams.egg-info/top_level.txt +0 -0
  182. {ltbams-0.9.11 → ltbams-0.9.12}/pyproject.toml +0 -0
  183. {ltbams-0.9.11 → ltbams-0.9.12}/requirements-extra.txt +0 -0
  184. {ltbams-0.9.11 → ltbams-0.9.12}/setup.cfg +0 -0
  185. {ltbams-0.9.11 → ltbams-0.9.12}/tests/__init__.py +0 -0
  186. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_addressing.py +0 -0
  187. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_andes_mats.py +0 -0
  188. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_benchmarks.py +0 -0
  189. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_case.py +0 -0
  190. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_export_csv.py +0 -0
  191. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_group.py +0 -0
  192. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_io.py +0 -0
  193. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_jumper.py +0 -0
  194. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_matp.py +0 -0
  195. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_model.py +0 -0
  196. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_paths.py +0 -0
  197. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_report.py +0 -0
  198. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_repr.py +0 -0
  199. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_routine.py +0 -0
  200. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_rtn_dcopf.py +0 -0
  201. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_rtn_ed.py +0 -0
  202. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_rtn_pflow.py +0 -0
  203. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_rtn_uc.py +0 -0
  204. {ltbams-0.9.11 → ltbams-0.9.12}/tests/test_service.py +0 -0
  205. {ltbams-0.9.11 → ltbams-0.9.12}/versioneer.py +0 -0
ltbams-0.9.12/PKG-INFO ADDED
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.1
2
+ Name: ltbams
3
+ Version: 0.9.12
4
+ Summary: Python software for scheduling modeling and co-simulation with dynanics.
5
+ Home-page: https://github.com/CURENT/ams
6
+ Author: Jinning Wang
7
+ Author-email: jinninggm@gmail.com
8
+ License: GNU Public License v3
9
+ Platform: UNKNOWN
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Natural Language :: English
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
14
+ Classifier: Environment :: Console
15
+ Description-Content-Type: text/markdown
16
+ Provides-Extra: all
17
+ Provides-Extra: coverage
18
+ Provides-Extra: dev
19
+ Provides-Extra: doc
20
+ Provides-Extra: flake8
21
+ Provides-Extra: ipython
22
+ Provides-Extra: myst-parser
23
+ Provides-Extra: nbsphinx
24
+ Provides-Extra: numpydoc
25
+ Provides-Extra: pandoc
26
+ Provides-Extra: pydata-sphinx-theme
27
+ Provides-Extra: pyscipopt
28
+ Provides-Extra: pytest
29
+ Provides-Extra: pytest-cov
30
+ Provides-Extra: sphinx
31
+ Provides-Extra: sphinx-copybutton
32
+ Provides-Extra: sphinx-panels
33
+ Provides-Extra: toml
34
+ License-File: LICENSE
35
+
36
+ # LTB AMS
37
+
38
+ Python Software for Power System Scheduling Modeling and Co-Simulation with Dynanic, serving as the market simulator for the [CURENT Largescale Testbed][LTB Repository].
39
+
40
+ [![License: GPL-3.0](https://img.shields.io/badge/License-GPL--3.0-blue.svg)](https://github.com/CURENT/ams/blob/master/LICENSE)
41
+ ![platforms](https://anaconda.org/conda-forge/ltbams/badges/platforms.svg)
42
+ [![Python Versions](https://img.shields.io/badge/Python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/)
43
+ ![Repo Size](https://img.shields.io/github/repo-size/CURENT/ams)
44
+ [![GitHub last commit (master)](https://img.shields.io/github/last-commit/CURENT/ams/master?label=last%20commit%20to%20master)](https://github.com/CURENT/ams/commits/master/)
45
+ [![GitHub last commit (develop)](https://img.shields.io/github/last-commit/CURENT/ams/develop?label=last%20commit%20to%20develop)](https://github.com/CURENT/ams/commits/develop/)
46
+ [![libraries](https://img.shields.io/librariesio/release/pypi/ltbams)](https://libraries.io/pypi/ltbams)
47
+ [![Structure](https://img.shields.io/badge/code_base-visualize-blue)](https://mango-dune-07a8b7110.1.azurestaticapps.net/?repo=CURENT%2Fams)
48
+
49
+ <img src="docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png" alt="CURENT ERC Logo" width="300" height="auto">
50
+
51
+ | | Latest | Stable |
52
+ |---------------|-----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
53
+ | Documentation | [![Latest Documentation](https://readthedocs.org/projects/ams/badge/?version=latest)](https://ams.readthedocs.io/en/latest/?badge=latest) | [![Documentation Status](https://readthedocs.org/projects/ams/badge/?version=stable)](https://ams.readthedocs.io/en/stable/?badge=stable) |
54
+
55
+
56
+ | Badges | | |
57
+ |---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
58
+ | Downloads | [![PyPI Version](https://img.shields.io/pypi/v/ltbams.svg)](https://pypi.python.org/pypi/ltbams) | [![Conda Version](https://anaconda.org/conda-forge/ltbams/badges/version.svg)](https://anaconda.org/conda-forge/ltbams) |
59
+ | Try on Binder | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/curent/ams/master) | |
60
+ | Code Quality |[![Codacy Badge](https://app.codacy.com/project/badge/Grade/69456da1b8634f2f984bd769e35f0050)](https://app.codacy.com/gh/CURENT/ams/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)| [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/69456da1b8634f2f984bd769e35f0050)](https://app.codacy.com/gh/CURENT/ams/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage) |
61
+ | Build Status | [![GitHub Action Status](https://github.com/CURENT/ams/workflows/Python%20application/badge.svg)](https://github.com/curent/ams/actions) | [![Build Status](https://dev.azure.com/curentltb/ams/_apis/build/status%2FCURENT.ams?branchName=master)](https://dev.azure.com/curentltb/ams/_build/latest?definitionId=2&branchName=master) |
62
+
63
+
64
+ # Why AMS
65
+
66
+ With the built-in interface with ANDES, AMS enables **Dynamics Incorporated**
67
+ **Stability-Constrained Scheduling**.
68
+
69
+ AMS is a **Modeling Framework** that provides a descriptive way to formulate
70
+ scheduling problems. The optimization problems are then handled by **CVXPY**
71
+ and solved with third-party solvers.
72
+
73
+ AMS produces credible scheduling results and competitive performance.
74
+ The following results show the comparison of DCOPF between AMS and other tools.
75
+
76
+ | Cost [\$] | AMS | MATPOWER | pandapower |
77
+ |----------------:|--------------:|------------:|-----------:|
78
+ | PEGASE 1354-Bus | 1,173,590.63 | 1,173,590.63 | 1,173,590.63 |
79
+ | PEGASE 2869-Bus | 2,338,915.61 | 2,338,915.61 | 2,338,915.61 |
80
+ | GOC 4020-Bus | 793,634.11 | 793,634.11 | 793,634.11 |
81
+ | EPIGRIDS 5658-Bus| 1,195,466.12 | 1,195,466.12 | 1,195,466.12 |
82
+ | EPIGRIDS 7336-Bus| 1,855,870.94 | 1,855,870.94 | 1,855,870.94 |
83
+
84
+ <img src="docs/source/images/dcopf_time.png" alt="DCOPF Time" width="400" height="auto">
85
+
86
+ AMS is currently under active development.
87
+ Use the following resources to get involved.
88
+
89
+ - Start from the [documentation][readthedocs] for installation and tutorial.
90
+ - Check out examples in the [examples folder][examples]
91
+ - Read the model verification results in the [examples/verification folder][verification]
92
+ - Ask a question in the [GitHub Discussions][Github Discussions]
93
+ - Report bugs or issues by submitting a [GitHub issue][GitHub issues]
94
+ - Submit contributions using [pull requests][GitHub pull requests]
95
+ - Read release notes highlighted [here][release notes]
96
+ - Try in Jupyter Notebook on [Binder][Binder]
97
+ <!-- + Check out and and cite our [paper][arxiv paper] -->
98
+
99
+ # Installation
100
+
101
+ ***NOTE:***
102
+ - Version **0.9.9** has known issues and has been yanked from PyPI
103
+ - `kvxopt` is recommended to install via `conda` as sometimes ``pip`` struggles to set the correct path for compiled libraries
104
+ - `cvxpy` versions **below 1.5** are incompatible with `numpy` versions **2.0 and above**
105
+
106
+ AMS is released as ``ltbams`` on PyPI and conda-forge.
107
+ Install from PyPI using pip:
108
+
109
+ ```bash
110
+ pip install ltbams
111
+ ```
112
+
113
+ Install from conda-forge using conda:
114
+
115
+ ```bash
116
+ conda install conda-forge::ltbams
117
+ ```
118
+
119
+ Install from GitHub source:
120
+
121
+ ```bash
122
+ pip install git+https://github.com/CURENT/ams.git
123
+ ```
124
+
125
+ # Example Usage
126
+
127
+ Using AMS to run a Real-Time Economic Dispatch (RTED) simulation:
128
+
129
+ ```python
130
+ import ams
131
+
132
+ ss = ams.load(ams.get_case('ieee14_uced.xlsx'))
133
+ ss.RTED.run()
134
+
135
+ print(ss.RTED.pg.v)
136
+ ```
137
+
138
+ # Sponsors and Contributors
139
+ AMS is the scheduling simulation engine for the CURENT Largescale Testbed (LTB).
140
+ More information about CURENT LTB can be found at the [LTB Repository][LTB Repository].
141
+
142
+ This work was supported in part by the Engineering Research Center Program of the National Science Foundation and the Department of Energy
143
+ under NSF Award Number EEC-1041877 and the CURENT Industry Partnership Program.
144
+
145
+ This work was supported in part by the Advanced Grid Research and Development Program in the Office of Electricity at the U.S. Department of Energy.
146
+
147
+ See [GitHub contributors][GitHub contributors] for the contributor list.
148
+
149
+ # License
150
+ AMS is licensed under the [GPL v3 License](./LICENSE).
151
+
152
+ # Related Projects
153
+ - [Popular Open Source Libraries for Power System Analysis](https://github.com/jinningwang/best-of-ps)
154
+ - [G-PST Tools Portal](https://g-pst.github.io/tools/): An open tools portal with a classification approach
155
+ - [Open Source Software (OSS) for Electricity Market Research, Teaching, and Training](https://www2.econ.iastate.edu/tesfatsi/ElectricOSS.htm)
156
+
157
+ Some commercial solvers provide academic licenses, such as COPT, GUROBI, CPLEX, and MOSEK.
158
+
159
+ * * *
160
+
161
+ [GitHub releases]: https://github.com/CURENT/ams/releases
162
+ [GitHub issues]: https://github.com/CURENT/ams/issues
163
+ [Github Discussions]: https://github.com/CURENT/ams/discussions
164
+ [GitHub insights]: https://github.com/CURENT/ams/pulse
165
+ [GitHub pull requests]: https://github.com/CURENT/ams/pulls
166
+ [GitHub contributors]: https://github.com/CURENT/ams/graphs/contributors
167
+ [readthedocs]: https://ams.readthedocs.io
168
+ [release notes]: https://ams.readthedocs.io/en/latest/release-notes.html
169
+ [examples]: https://github.com/CURENT/ams/tree/master/examples
170
+ [verification]: https://github.com/CURENT/ams/tree/master/examples/verification
171
+ [Binder]: https://mybinder.org/v2/gh/curent/ams/master
172
+ [LTB Repository]: https://github.com/CURENT
173
+
@@ -28,7 +28,12 @@ Python Software for Power System Scheduling Modeling and Co-Simulation with Dyna
28
28
 
29
29
  # Why AMS
30
30
 
31
- With the built-in interface with dynamic simulation engine, ANDES, AMS enables Dynamics Interfaced Stability Constrained Production Cost and Market Operation Modeling.
31
+ With the built-in interface with ANDES, AMS enables **Dynamics Incorporated**
32
+ **Stability-Constrained Scheduling**.
33
+
34
+ AMS is a **Modeling Framework** that provides a descriptive way to formulate
35
+ scheduling problems. The optimization problems are then handled by **CVXPY**
36
+ and solved with third-party solvers.
32
37
 
33
38
  AMS produces credible scheduling results and competitive performance.
34
39
  The following results show the comparison of DCOPF between AMS and other tools.
@@ -59,7 +64,7 @@ Use the following resources to get involved.
59
64
  # Installation
60
65
 
61
66
  ***NOTE:***
62
- - Version **0.9.9** has known issues. Please avoid using this version
67
+ - Version **0.9.9** has known issues and has been yanked from PyPI
63
68
  - `kvxopt` is recommended to install via `conda` as sometimes ``pip`` struggles to set the correct path for compiled libraries
64
69
  - `cvxpy` versions **below 1.5** are incompatible with `numpy` versions **2.0 and above**
65
70
 
@@ -1,6 +1,7 @@
1
1
  from . import _version
2
2
  __version__ = _version.get_versions()['version']
3
3
 
4
+ from ams import opt # NOQA
4
5
  from ams import benchmarks # NOQA
5
6
 
6
7
  from ams.main import config_logger, load, run # NOQA
@@ -10,4 +11,4 @@ from ams.shared import ppc2df # NOQA
10
11
 
11
12
  __author__ = 'Jining Wang'
12
13
 
13
- __all__ = ['System', 'get_case', 'System']
14
+ __all__ = ['System', 'get_case']
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-11-14T16:34:57-0500",
11
+ "date": "2024-11-23T17:09:40-0500",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "9dcd290dc6532149fcd0b4f26fb5e9af4bf4bf36",
15
- "version": "0.9.11"
14
+ "full-revisionid": "377b36f113e1e88f8c2d21d3c6ab8ff3728cffb0",
15
+ "version": "0.9.12"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -223,9 +223,10 @@ class RDocumenter:
223
223
  # add tables
224
224
  self.parent.syms.generate_symbols()
225
225
  out += self._obj_doc(max_width=max_width, export=export)
226
- out += self._constr_doc(max_width=max_width, export=export)
227
226
  out += self._expr_doc(max_width=max_width, export=export)
227
+ out += self._constr_doc(max_width=max_width, export=export)
228
228
  out += self._var_doc(max_width=max_width, export=export)
229
+ out += self._exprc_doc(max_width=max_width, export=export)
229
230
  out += self._service_doc(max_width=max_width, export=export)
230
231
  out += self._param_doc(max_width=max_width, export=export)
231
232
  out += self.config.doc(max_width=max_width, export=export)
@@ -316,17 +317,26 @@ class RDocumenter:
316
317
  rest_dict=rest_dict)
317
318
 
318
319
  def _expr_doc(self, max_width=78, export='plain'):
319
- # expression documentation
320
+ # Expression documentation
320
321
  if len(self.parent.exprs) == 0:
321
322
  return ''
322
323
 
323
324
  # prepare temporary lists
324
- names, var_names, info = list(), list(), list()
325
+ names, info = list(), list()
326
+ units, sources, units_rest = list(), list(), list()
325
327
 
326
328
  for p in self.parent.exprs.values():
327
329
  names.append(p.name)
328
- var_names.append(p.var)
329
330
  info.append(p.info if p.info else '')
331
+ units.append(p.unit if p.unit else '')
332
+ units_rest.append(f'*{p.unit}*' if p.unit else '')
333
+
334
+ slist = []
335
+ if p.owner is not None and p.src is not None:
336
+ slist.append(f'{p.owner.class_name}.{p.src}')
337
+ elif p.owner is not None and p.src is None:
338
+ slist.append(f'{p.owner.class_name}')
339
+ sources.append(','.join(slist))
330
340
 
331
341
  # expressions based on output format
332
342
  expressions = []
@@ -342,13 +352,67 @@ class RDocumenter:
342
352
  expressions = math_wrap(expressions, export=export)
343
353
 
344
354
  plain_dict = OrderedDict([('Name', names),
345
- ('Variable', var_names),
346
355
  ('Description', info),
356
+ ('Unit', units),
357
+ ])
358
+ rest_dict = OrderedDict([('Name', names),
359
+ ('Description', info),
360
+ ('Expression', expressions),
361
+ ('Unit', units_rest),
362
+ ('Source', sources),
363
+ ])
364
+
365
+ # convert to rows and export as table
366
+ return make_doc_table(title=title,
367
+ max_width=max_width,
368
+ export=export,
369
+ plain_dict=plain_dict,
370
+ rest_dict=rest_dict)
371
+
372
+ def _exprc_doc(self, max_width=78, export='plain'):
373
+ # ExpressionCalc documentation
374
+ if len(self.parent.exprcs) == 0:
375
+ return ''
376
+
377
+ # prepare temporary lists
378
+ names, info = list(), list()
379
+ units, sources, units_rest = list(), list(), list()
380
+
381
+ for p in self.parent.exprcs.values():
382
+ names.append(p.name)
383
+ info.append(p.info if p.info else '')
384
+ units.append(p.unit if p.unit else '')
385
+ units_rest.append(f'*{p.unit}*' if p.unit else '')
386
+
387
+ slist = []
388
+ if p.owner is not None and p.src is not None:
389
+ slist.append(f'{p.owner.class_name}.{p.src}')
390
+ elif p.owner is not None and p.src is None:
391
+ slist.append(f'{p.owner.class_name}')
392
+ sources.append(','.join(slist))
393
+
394
+ # expressions based on output format
395
+ expressions = []
396
+ if export == 'rest':
397
+ for p in self.parent.exprcs.values():
398
+ expr = _tex_pre(self, p, self.parent.syms.tex_map)
399
+ logger.debug(f'{p.name} math: {expr}')
400
+ expressions.append(expr)
401
+
402
+ title = 'ExpressionCalcs\n----------------------------------'
403
+ else:
404
+ title = 'ExpressionCalcs'
405
+ expressions = math_wrap(expressions, export=export)
406
+
407
+ plain_dict = OrderedDict([('Name', names),
408
+ ('Description', info),
409
+ ('Unit', units),
347
410
  ])
348
411
  rest_dict = OrderedDict([('Name', names),
349
- ('Variable', var_names),
350
412
  ('Description', info),
351
413
  ('Expression', expressions),
414
+ ('Unit', units_rest),
415
+ ('Source', sources),
352
416
  ])
353
417
 
354
418
  # convert to rows and export as table
@@ -423,6 +487,8 @@ class RDocumenter:
423
487
  slist = []
424
488
  if p.owner is not None and p.src is not None:
425
489
  slist.append(f'{p.owner.class_name}.{p.src}')
490
+ elif p.owner is not None and p.src is None:
491
+ slist.append(f'{p.owner.class_name}')
426
492
  sources.append(','.join(slist))
427
493
 
428
494
  # symbols based on output format
@@ -490,6 +556,8 @@ class RDocumenter:
490
556
  slist = []
491
557
  if p.owner is not None and p.src is not None:
492
558
  slist.append(f'{p.owner.class_name}.{p.src}')
559
+ elif p.owner is not None and p.src is None:
560
+ slist.append(f'{p.owner.class_name}')
493
561
  sources.append(','.join(slist))
494
562
 
495
563
  # symbols based on output format
@@ -13,7 +13,7 @@ from andes.thirdparty.npfunc import safe_div
13
13
  from andes.shared import tqdm, tqdm_nb
14
14
  from andes.utils.misc import elapsed, is_notebook
15
15
 
16
- from ams.opt.omodel import Param
16
+ from ams.opt import Param
17
17
  from ams.shared import pd, sps
18
18
 
19
19
  logger = logging.getLogger(__name__)
@@ -140,7 +140,9 @@ class MParam(Param):
140
140
 
141
141
  class MatProcessor:
142
142
  """
143
- Class for matrix processing in AMS system.
143
+ Class for matrices processing in AMS system.
144
+ The connectivity matrices `Cft`, `Cg`, `Cl`, and `Csh` ***have taken*** the
145
+ devices connectivity into account.
144
146
 
145
147
  The MParams' row names and col names are assigned in `System.setup()`.
146
148
  """
@@ -10,7 +10,7 @@ from typing import Optional, Iterable
10
10
  import numpy as np
11
11
  from scipy.sparse import issparse
12
12
 
13
- from ams.opt.omodel import Param
13
+ from ams.opt import Param
14
14
 
15
15
  logger = logging.getLogger(__name__)
16
16
 
@@ -10,7 +10,7 @@ import scipy.sparse as spr
10
10
 
11
11
  from andes.core.service import BaseService
12
12
 
13
- from ams.opt.omodel import Param
13
+ from ams.opt import Param
14
14
 
15
15
 
16
16
  logger = logging.getLogger(__name__)
@@ -33,8 +33,6 @@ class RBaseService(BaseService, Param):
33
33
  Description.
34
34
  vtype : Type, optional
35
35
  Variable type.
36
- model : str, optional
37
- Model name.
38
36
  no_parse: bool, optional
39
37
  True to skip parsing the service.
40
38
  sparse: bool, optional
@@ -106,8 +104,8 @@ class ValueService(RBaseService):
106
104
  Description.
107
105
  vtype : Type, optional
108
106
  Variable type.
109
- model : str, optional
110
- Model name.
107
+ no_parse: bool, optional
108
+ True to skip parsing the service.
111
109
  sparse: bool, optional
112
110
  True to return output as scipy csr_matrix.
113
111
  """
@@ -155,8 +153,8 @@ class ROperationService(RBaseService):
155
153
  Description.
156
154
  vtype : Type, optional
157
155
  Variable type.
158
- model : str, optional
159
- Model name.
156
+ no_parse: bool, optional
157
+ True to skip parsing the service.
160
158
  sparse: bool, optional
161
159
  True to return output as scipy csr_matrix.
162
160
  """
@@ -194,6 +192,8 @@ class LoadScale(ROperationService):
194
192
  Unit.
195
193
  info : str, optional
196
194
  Description.
195
+ no_parse: bool, optional
196
+ True to skip parsing the service.
197
197
  sparse: bool, optional
198
198
  True to return output as scipy csr_matrix.
199
199
  """
@@ -236,7 +236,7 @@ class NumOp(ROperationService):
236
236
 
237
237
  Note that the scalar output is converted to a 1D array.
238
238
 
239
- The optional kwargs are passed to the input function.
239
+ The `rargs` are passed to the input function.
240
240
 
241
241
  Parameters
242
242
  ----------
@@ -397,8 +397,6 @@ class NumOpDual(NumOp):
397
397
  Description.
398
398
  vtype : Type, optional
399
399
  Variable type.
400
- model : str, optional
401
- Model name.
402
400
  rfun : Callable, optional
403
401
  Function to apply to the output of ``fun``.
404
402
  rargs : dict, optional
@@ -407,6 +405,8 @@ class NumOpDual(NumOp):
407
405
  Expand the dimensions of the output array along a specified axis.
408
406
  array_out : bool, optional
409
407
  Whether to force the output to be an array.
408
+ no_parse: bool, optional
409
+ True to skip parsing the service.
410
410
  sparse: bool, optional
411
411
  True to return output as scipy csr_matrix.
412
412
  """
@@ -467,6 +467,10 @@ class MinDur(NumOpDual):
467
467
  Unit.
468
468
  info : str, optional
469
469
  Description.
470
+ vtype : Type, optional
471
+ Variable type.
472
+ no_parse: bool, optional
473
+ True to skip parsing the service.
470
474
  sparse: bool, optional
471
475
  True to return output as scipy csr_matrix.
472
476
  """
@@ -537,8 +541,12 @@ class NumHstack(NumOp):
537
541
  Description.
538
542
  vtype : Type, optional
539
543
  Variable type.
540
- model : str, optional
541
- Model name.
544
+ rfun : Callable, optional
545
+ Function to apply to the output of ``fun``.
546
+ rargs : dict, optional
547
+ Keyword arguments to pass to ``rfun``.
548
+ no_parse: bool, optional
549
+ True to skip parsing the service.
542
550
  sparse: bool, optional
543
551
  True to return output as scipy csr_matrix.
544
552
  """
@@ -624,8 +632,12 @@ class ZonalSum(NumOp):
624
632
  Description.
625
633
  vtype : Type
626
634
  Variable type.
627
- model : str
628
- Model name.
635
+ rfun : Callable, optional
636
+ Function to apply to the output of ``fun``.
637
+ rargs : dict, optional
638
+ Keyword arguments to pass to ``rfun``.
639
+ no_parse: bool, optional
640
+ True to skip parsing the service.
629
641
  sparse: bool, optional
630
642
  True to return output as scipy csr_matrix.
631
643
  """
@@ -676,7 +688,7 @@ class VarSelect(NumOp):
676
688
  A numerical matrix to select a subset of a 2D variable,
677
689
  ``u.v[:, idx]``.
678
690
 
679
- For example, if nned to select Energy Storage output
691
+ For example, if need to select Energy Storage output
680
692
  power from StaticGen `pg`, following definition can be used:
681
693
  ```python
682
694
  class RTED:
@@ -709,6 +721,8 @@ class VarSelect(NumOp):
709
721
  Keyword arguments to pass to ``rfun``.
710
722
  array_out : bool, optional
711
723
  Whether to force the output to be an array.
724
+ no_parse: bool, optional
725
+ True to skip parsing the service.
712
726
  sparse: bool, optional
713
727
  True to return output as scipy csr_matrix.
714
728
  """
@@ -790,7 +804,7 @@ class VarReduction(NumOp):
790
804
  u : Callable
791
805
  The input matrix variable.
792
806
  fun : Callable
793
- The reduction function that takes a shape parameter (1D shape) as input.
807
+ The reduction function that takes a shape argument (1D shape) as input.
794
808
  name : str, optional
795
809
  The name of the instance.
796
810
  tex_name : str, optional
@@ -801,8 +815,12 @@ class VarReduction(NumOp):
801
815
  A description of the operation.
802
816
  vtype : Type, optional
803
817
  The variable type.
804
- model : str, optional
805
- The model name associated with the operation.
818
+ rfun : Callable, optional
819
+ Function to apply to the output of ``fun``.
820
+ rargs : dict, optional
821
+ Keyword arguments to pass to ``rfun``.
822
+ no_parse: bool, optional
823
+ True to skip parsing the service.
806
824
  sparse: bool, optional
807
825
  True to return output as scipy csr_matrix.
808
826
  """
@@ -818,13 +836,11 @@ class VarReduction(NumOp):
818
836
  rfun: Callable = None,
819
837
  rargs: dict = None,
820
838
  no_parse: bool = False,
821
- sparse: bool = False,
822
- **kwargs):
839
+ sparse: bool = False,):
823
840
  super().__init__(name=name, tex_name=tex_name, unit=unit,
824
841
  info=info, vtype=vtype,
825
842
  u=u, fun=None, rfun=rfun, rargs=rargs,
826
- no_parse=no_parse, sparse=sparse,
827
- **kwargs)
843
+ no_parse=no_parse, sparse=sparse,)
828
844
  self.fun = fun
829
845
 
830
846
  @property
@@ -859,8 +875,12 @@ class RampSub(NumOp):
859
875
  Description.
860
876
  vtype : Type
861
877
  Variable type.
862
- model : str
863
- Model name.
878
+ rfun : Callable, optional
879
+ Function to apply to the output of ``fun``.
880
+ rargs : dict, optional
881
+ Keyword arguments to pass to ``rfun``.
882
+ no_parse: bool, optional
883
+ True to skip parsing the service.
864
884
  sparse: bool, optional
865
885
  True to return output as scipy csr_matrix.
866
886
  """
@@ -89,6 +89,9 @@ class SymProcessor:
89
89
  (r'(== 0|<= 0)$', ''), # remove the comparison operator
90
90
  (r'cp\.(Minimize|Maximize)', r'float'), # remove cp.Minimize/Maximize
91
91
  (r'\bcp.\b', 'np.'),
92
+ (r'\bexp\b', 'np.exp'),
93
+ (r'\blog\b', 'np.log'),
94
+ (r'\bconj\b', 'np.conj'),
92
95
  ])
93
96
 
94
97
  self.status = {
@@ -124,9 +127,7 @@ class SymProcessor:
124
127
 
125
128
  # Vars
126
129
  for vname, var in self.parent.vars.items():
127
- tmp = sp.symbols(f'{var.name}')
128
- # tmp = sp.symbols(var.name)
129
- self.inputs_dict[vname] = tmp
130
+ self.inputs_dict[vname] = sp.symbols(f'{vname}')
130
131
  self.sub_map[rf"\b{vname}\b"] = f"self.om.{vname}"
131
132
  self.tex_map[rf"\b{vname}\b"] = rf'{var.tex_name}'
132
133
  self.val_map[rf"\b{vname}\b"] = f"rtn.{vname}.v"
@@ -163,6 +164,13 @@ class SymProcessor:
163
164
  if not service.no_parse:
164
165
  self.val_map[rf"\b{sname}\b"] = f"rtn.{sname}.v"
165
166
 
167
+ # Expressions
168
+ for ename, expr in self.parent.exprs.items():
169
+ self.inputs_dict[ename] = sp.symbols(f'{ename}')
170
+ self.sub_map[rf"\b{ename}\b"] = f"self.om.{ename}"
171
+ self.val_map[rf"\b{ename}\b"] = f"rtn.{ename}.v"
172
+ self.tex_map[rf"\b{ename}\b"] = f'{expr.tex_name}'
173
+
166
174
  # Constraints
167
175
  # NOTE: constraints are included in sub_map for ExpressionCalc
168
176
  # thus, they don't have the suffix `.v`