ltbams 1.0.5__tar.gz → 1.0.6__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 (202) hide show
  1. {ltbams-1.0.5/ltbams.egg-info → ltbams-1.0.6}/PKG-INFO +1 -1
  2. {ltbams-1.0.5 → ltbams-1.0.6}/ams/_version.py +3 -3
  3. {ltbams-1.0.5 → ltbams-1.0.6}/ams/io/matpower.py +7 -0
  4. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/cost.py +2 -0
  5. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/dcopf.py +5 -5
  6. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/dcopf2.py +2 -2
  7. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/ed.py +2 -3
  8. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/uc.py +4 -6
  9. {ltbams-1.0.5 → ltbams-1.0.6}/ams/shared.py +1 -1
  10. {ltbams-1.0.5 → ltbams-1.0.6}/ams/system.py +7 -0
  11. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/conf.py +1 -1
  12. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/examples/index.rst +0 -4
  13. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/release-notes.rst +6 -0
  14. {ltbams-1.0.5 → ltbams-1.0.6/ltbams.egg-info}/PKG-INFO +1 -1
  15. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_case.py +27 -0
  16. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_io.py +9 -0
  17. {ltbams-1.0.5 → ltbams-1.0.6}/CONTRIBUTING.rst +0 -0
  18. {ltbams-1.0.5 → ltbams-1.0.6}/LICENSE +0 -0
  19. {ltbams-1.0.5 → ltbams-1.0.6}/MANIFEST.in +0 -0
  20. {ltbams-1.0.5 → ltbams-1.0.6}/README.md +0 -0
  21. {ltbams-1.0.5 → ltbams-1.0.6}/ams/__init__.py +0 -0
  22. {ltbams-1.0.5 → ltbams-1.0.6}/ams/__main__.py +0 -0
  23. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/5bus/pjm5bus_demo.xlsx +0 -0
  24. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/5bus/pjm5bus_jumper.xlsx +0 -0
  25. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/5bus/pjm5bus_uced.json +0 -0
  26. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/5bus/pjm5bus_uced.xlsx +0 -0
  27. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/5bus/pjm5bus_uced_esd1.xlsx +0 -0
  28. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/5bus/pjm5bus_uced_ev.xlsx +0 -0
  29. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee123/ieee123.xlsx +0 -0
  30. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee123/ieee123_regcv1.xlsx +0 -0
  31. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee14/ieee14.json +0 -0
  32. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee14/ieee14.raw +0 -0
  33. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee14/ieee14_conn.xlsx +0 -0
  34. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee14/ieee14_uced.xlsx +0 -0
  35. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee39/ieee39.xlsx +0 -0
  36. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee39/ieee39_uced.xlsx +0 -0
  37. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee39/ieee39_uced_esd1.xlsx +0 -0
  38. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee39/ieee39_uced_pvd1.xlsx +0 -0
  39. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/ieee39/ieee39_uced_vis.xlsx +0 -0
  40. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/matpower/benchmark.json +0 -0
  41. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/matpower/case118.m +0 -0
  42. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/matpower/case14.m +0 -0
  43. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/matpower/case300.m +0 -0
  44. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/matpower/case39.m +0 -0
  45. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/matpower/case5.m +0 -0
  46. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/matpower/case_ACTIVSg2000.m +0 -0
  47. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/npcc/npcc.m +0 -0
  48. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/npcc/npcc_uced.xlsx +0 -0
  49. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/pglib/pglib_opf_case39_epri__api.m +0 -0
  50. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/wecc/wecc.m +0 -0
  51. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cases/wecc/wecc_uced.xlsx +0 -0
  52. {ltbams-1.0.5 → ltbams-1.0.6}/ams/cli.py +0 -0
  53. {ltbams-1.0.5 → ltbams-1.0.6}/ams/core/__init__.py +0 -0
  54. {ltbams-1.0.5 → ltbams-1.0.6}/ams/core/documenter.py +0 -0
  55. {ltbams-1.0.5 → ltbams-1.0.6}/ams/core/matprocessor.py +0 -0
  56. {ltbams-1.0.5 → ltbams-1.0.6}/ams/core/model.py +0 -0
  57. {ltbams-1.0.5 → ltbams-1.0.6}/ams/core/param.py +0 -0
  58. {ltbams-1.0.5 → ltbams-1.0.6}/ams/core/service.py +0 -0
  59. {ltbams-1.0.5 → ltbams-1.0.6}/ams/core/symprocessor.py +0 -0
  60. {ltbams-1.0.5 → ltbams-1.0.6}/ams/core/var.py +0 -0
  61. {ltbams-1.0.5 → ltbams-1.0.6}/ams/extension/__init__.py +0 -0
  62. {ltbams-1.0.5 → ltbams-1.0.6}/ams/extension/eva.py +0 -0
  63. {ltbams-1.0.5 → ltbams-1.0.6}/ams/interface.py +0 -0
  64. {ltbams-1.0.5 → ltbams-1.0.6}/ams/io/__init__.py +0 -0
  65. {ltbams-1.0.5 → ltbams-1.0.6}/ams/io/json.py +0 -0
  66. {ltbams-1.0.5 → ltbams-1.0.6}/ams/io/psse.py +0 -0
  67. {ltbams-1.0.5 → ltbams-1.0.6}/ams/io/pypower.py +0 -0
  68. {ltbams-1.0.5 → ltbams-1.0.6}/ams/io/xlsx.py +0 -0
  69. {ltbams-1.0.5 → ltbams-1.0.6}/ams/main.py +0 -0
  70. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/__init__.py +0 -0
  71. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/area.py +0 -0
  72. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/bus.py +0 -0
  73. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/distributed/__init__.py +0 -0
  74. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/distributed/esd1.py +0 -0
  75. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/distributed/ev.py +0 -0
  76. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/distributed/pvd1.py +0 -0
  77. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/group.py +0 -0
  78. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/info.py +0 -0
  79. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/line.py +0 -0
  80. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/renewable/__init__.py +0 -0
  81. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/renewable/regc.py +0 -0
  82. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/reserve.py +0 -0
  83. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/shunt.py +0 -0
  84. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/static/__init__.py +0 -0
  85. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/static/gen.py +0 -0
  86. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/static/pq.py +0 -0
  87. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/timeslot.py +0 -0
  88. {ltbams-1.0.5 → ltbams-1.0.6}/ams/models/zone.py +0 -0
  89. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/__init__.py +0 -0
  90. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/constraint.py +0 -0
  91. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/exprcalc.py +0 -0
  92. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/expression.py +0 -0
  93. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/objective.py +0 -0
  94. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/omodel.py +0 -0
  95. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/optzbase.py +0 -0
  96. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/param.py +0 -0
  97. {ltbams-1.0.5 → ltbams-1.0.6}/ams/opt/var.py +0 -0
  98. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/__init__.py +0 -0
  99. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/_compat.py +0 -0
  100. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/core/__init__.py +0 -0
  101. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/core/pips.py +0 -0
  102. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/core/ppoption.py +0 -0
  103. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/core/ppver.py +0 -0
  104. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/core/solver.py +0 -0
  105. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/eps.py +0 -0
  106. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/idx.py +0 -0
  107. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/io.py +0 -0
  108. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/make/__init__.py +0 -0
  109. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/make/matrices.py +0 -0
  110. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/make/pdv.py +0 -0
  111. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/routines/__init__.py +0 -0
  112. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/routines/cpf.py +0 -0
  113. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/routines/cpf_callbacks.py +0 -0
  114. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/routines/opf.py +0 -0
  115. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/routines/opffcns.py +0 -0
  116. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/routines/pflow.py +0 -0
  117. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/toggle.py +0 -0
  118. {ltbams-1.0.5 → ltbams-1.0.6}/ams/pypower/utils.py +0 -0
  119. {ltbams-1.0.5 → ltbams-1.0.6}/ams/report.py +0 -0
  120. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/__init__.py +0 -0
  121. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/acopf.py +0 -0
  122. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/cpf.py +0 -0
  123. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/dcpf.py +0 -0
  124. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/dcpf0.py +0 -0
  125. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/dopf.py +0 -0
  126. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/pflow.py +0 -0
  127. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/pflow0.py +0 -0
  128. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/routine.py +0 -0
  129. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/rted.py +0 -0
  130. {ltbams-1.0.5 → ltbams-1.0.6}/ams/routines/type.py +0 -0
  131. {ltbams-1.0.5 → ltbams-1.0.6}/ams/utils/__init__.py +0 -0
  132. {ltbams-1.0.5 → ltbams-1.0.6}/ams/utils/misc.py +0 -0
  133. {ltbams-1.0.5 → ltbams-1.0.6}/ams/utils/paths.py +0 -0
  134. {ltbams-1.0.5 → ltbams-1.0.6}/docs/Makefile +0 -0
  135. {ltbams-1.0.5 → ltbams-1.0.6}/docs/make.bat +0 -0
  136. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/_templates/autosummary/base.rst +0 -0
  137. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/_templates/autosummary/class.rst +0 -0
  138. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/_templates/autosummary/module.rst +0 -0
  139. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/_templates/autosummary/module_toctree.rst +0 -0
  140. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/api.rst +0 -0
  141. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/genmodelref.py +0 -0
  142. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/genroutineref.py +0 -0
  143. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/copyright.rst +0 -0
  144. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/formats/index.rst +0 -0
  145. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/formats/matpower.rst +0 -0
  146. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/formats/psse.rst +0 -0
  147. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/formats/pypower.rst +0 -0
  148. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/formats/xlsx.png +0 -0
  149. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/formats/xlsx.rst +0 -0
  150. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/index.rst +0 -0
  151. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/install.rst +0 -0
  152. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/overview.rst +0 -0
  153. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/testcase.rst +0 -0
  154. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/getting_started/verification.rst +0 -0
  155. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/images/curent.ico +0 -0
  156. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/images/dcopf_time.png +0 -0
  157. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png +0 -0
  158. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/images/sponsors/CURENT_Logo_Transparent.png +0 -0
  159. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/images/sponsors/CURENT_Logo_Transparent_Name.png +0 -0
  160. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/images/sponsors/doe.png +0 -0
  161. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/index.rst +0 -0
  162. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/modeling/example.rst +0 -0
  163. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/modeling/index.rst +0 -0
  164. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/modeling/model.rst +0 -0
  165. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/modeling/routine.rst +0 -0
  166. {ltbams-1.0.5 → ltbams-1.0.6}/docs/source/modeling/system.rst +0 -0
  167. {ltbams-1.0.5 → ltbams-1.0.6}/ltbams.egg-info/SOURCES.txt +0 -0
  168. {ltbams-1.0.5 → ltbams-1.0.6}/ltbams.egg-info/dependency_links.txt +0 -0
  169. {ltbams-1.0.5 → ltbams-1.0.6}/ltbams.egg-info/entry_points.txt +0 -0
  170. {ltbams-1.0.5 → ltbams-1.0.6}/ltbams.egg-info/requires.txt +0 -0
  171. {ltbams-1.0.5 → ltbams-1.0.6}/ltbams.egg-info/top_level.txt +0 -0
  172. {ltbams-1.0.5 → ltbams-1.0.6}/pyproject.toml +0 -0
  173. {ltbams-1.0.5 → ltbams-1.0.6}/requirements-dev.txt +0 -0
  174. {ltbams-1.0.5 → ltbams-1.0.6}/requirements.txt +0 -0
  175. {ltbams-1.0.5 → ltbams-1.0.6}/setup.cfg +0 -0
  176. {ltbams-1.0.5 → ltbams-1.0.6}/setup.py +0 -0
  177. {ltbams-1.0.5 → ltbams-1.0.6}/tests/__init__.py +0 -0
  178. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_1st_system.py +0 -0
  179. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_addressing.py +0 -0
  180. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_andes_mats.py +0 -0
  181. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_cli.py +0 -0
  182. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_export_csv.py +0 -0
  183. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_group.py +0 -0
  184. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_interface.py +0 -0
  185. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_jumper.py +0 -0
  186. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_known_good.py +0 -0
  187. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_matp.py +0 -0
  188. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_model.py +0 -0
  189. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_omodel.py +0 -0
  190. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_paths.py +0 -0
  191. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_report.py +0 -0
  192. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_repr.py +0 -0
  193. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_routine.py +0 -0
  194. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_rtn_dcopf.py +0 -0
  195. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_rtn_dcopf2.py +0 -0
  196. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_rtn_dcpf.py +0 -0
  197. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_rtn_ed.py +0 -0
  198. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_rtn_pflow.py +0 -0
  199. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_rtn_rted.py +0 -0
  200. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_rtn_uc.py +0 -0
  201. {ltbams-1.0.5 → ltbams-1.0.6}/tests/test_service.py +0 -0
  202. {ltbams-1.0.5 → ltbams-1.0.6}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ltbams
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Python software for scheduling modeling and co-simulation with dynamics.
5
5
  Home-page: https://github.com/CURENT/ams
6
6
  Author: Jinning Wang
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-04-09T22:08:11-0400",
11
+ "date": "2025-04-10T23:17:16-0400",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "115b1575b21ff871fe878121b3ca1cb6020b1a93",
15
- "version": "1.0.5"
14
+ "full-revisionid": "3dbdbfee9ce8361b7975c9333179b88c01560137",
15
+ "version": "1.0.6"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -203,6 +203,13 @@ def mpc2system(mpc: dict, system) -> bool:
203
203
  gcost_idx = 0
204
204
  gen_idx = np.arange(mpc['gen'].shape[0]) + 1
205
205
  mpc_cost = mpc['gencost']
206
+ if mpc_cost[0, 0] == 1:
207
+ logger.warning("Type 1 gencost detected. "
208
+ "This is not supported in AMS. "
209
+ "Default type 2 cost parameters will be used as a fallback."
210
+ "It is recommended to manually convert the gencost data to type 2.")
211
+ mpc_cost = np.repeat(np.array([[2, 0, 0, 3, 0, 0, 0]]),
212
+ mpc_cost.shape[0], axis=0)
206
213
  for data, gen in zip(mpc_cost, gen_idx):
207
214
  # NOTE: only type 2 costs are supported for now
208
215
  # type startup shutdown n c2 c1 c0
@@ -100,6 +100,7 @@ class SRCost(ModelData, Model):
100
100
  def __init__(self, system, config):
101
101
  ModelData.__init__(self)
102
102
  Model.__init__(self, system, config)
103
+ self.group = 'Cost'
103
104
  self.gen = IdxParam(info="static generator index",
104
105
  model='StaticGen',
105
106
  mandatory=True,)
@@ -116,6 +117,7 @@ class NSRCost(ModelData, Model):
116
117
  def __init__(self, system, config):
117
118
  ModelData.__init__(self)
118
119
  Model.__init__(self, system, config)
120
+ self.group = 'Cost'
119
121
  self.gen = IdxParam(info="static generator index",
120
122
  model='StaticGen',
121
123
  mandatory=True,)
@@ -22,14 +22,14 @@ class DCOPF(DCPFBase):
22
22
  Notes
23
23
  -----
24
24
  1. The nodal price is calculated as ``pi`` in ``pic``.
25
- 1. Devices online status of `StaticGen`, `StaticLoad`, and `Shunt` are considered in the connectivity
26
- matrices `Cft`, `Cg`, `Cl`, and `Csh`.
25
+ 2. Devices online status of ``StaticGen``, ``StaticLoad``, and ``Shunt`` are considered in the connectivity
26
+ matrices ``Cft``, ``Cg``, ``Cl``, and ``Csh``.
27
27
 
28
28
  References
29
29
  ----------
30
- 1. R. D. Zimmerman, C. E. Murillo-Sanchez, and R. J. Thomas, “MATPOWER: Steady-State Operations, Planning, and
31
- Analysis Tools for Power Systems Research and Education,” IEEE Trans. Power Syst., vol. 26, no. 1, pp. 12–19,
32
- Feb. 2011
30
+ 1. R. D. Zimmerman, C. E. Murillo-Sanchez, and R. J. Thomas, “MATPOWER: Steady-State
31
+ Operations, Planning, and Analysis Tools for Power Systems Research and Education,” IEEE
32
+ Trans. Power Syst., vol. 26, no. 1, pp. 12-19, Feb. 2011
33
33
  """
34
34
 
35
35
  def __init__(self, system, config):
@@ -25,8 +25,8 @@ class DCOPF2(DCOPF):
25
25
  Notes
26
26
  -----
27
27
  1. This routine requires PTDF matrix.
28
- 1. Nodal price ``pi`` is calculated with three parts.
29
- 1. Bus angle ``aBus`` is calculated after solving the problem.
28
+ 2. Nodal price ``pi`` is calculated with three parts.
29
+ 3. Bus angle ``aBus`` is calculated after solving the problem.
30
30
  """
31
31
 
32
32
  def __init__(self, system, config):
@@ -109,8 +109,7 @@ class MPBase:
109
109
  class ED(RTED, MPBase, SRBase):
110
110
  """
111
111
  DC-based multi-period economic dispatch (ED).
112
- Dispath interval ``config.t`` (:math:`T_{cfg}`) is introduced,
113
- 1 [Hour] by default.
112
+ Dispath interval ``config.t`` (:math:``T_{cfg}``) is introduced, 1 [Hour] by default.
114
113
 
115
114
  ED extends DCOPF as follows:
116
115
 
@@ -124,7 +123,7 @@ class ED(RTED, MPBase, SRBase):
124
123
 
125
124
  2. The tie-line flow is not implemented in this model.
126
125
 
127
- 3. `EDTSlot.ug` is used instead of `StaticGen.u` for generator commitment.
126
+ 3. ``EDTSlot.ug`` is used instead of ``StaticGen.u`` for generator commitment.
128
127
  """
129
128
 
130
129
  def __init__(self, system, config):
@@ -70,17 +70,15 @@ class UC(DCOPF, RTEDBase, MPBase, SRBase, NSRBase):
70
70
  Notes
71
71
  -----
72
72
  1. Formulations has been adjusted with interval ``config.t``
73
-
74
- 3. The tie-line flow has not been implemented in formulations.
73
+ 2. The tie-line flow has not been implemented in formulations.
75
74
 
76
75
  References
77
76
  ----------
78
77
  1. Huang, Y., Pardalos, P. M., & Zheng, Q. P. (2017). Electrical power unit commitment: deterministic and
79
- two-stage stochastic programming models and algorithms. Springer.
80
-
78
+ two-stage stochastic programming models and algorithms. Springer.
81
79
  2. D. A. Tejada-Arango, S. Lumbreras, P. Sánchez-Martín and A. Ramos, "Which Unit-Commitment Formulation
82
- is Best? A Comparison Framework," in IEEE Transactions on Power Systems, vol. 35, no. 4, pp. 2926-2936,
83
- July 2020, doi: 10.1109/TPWRS.2019.2962024.
80
+ is Best? A Comparison Framework," in IEEE Transactions on Power Systems, vol. 35, no. 4, pp. 2926-2936,
81
+ July 2020, doi: 10.1109/TPWRS.2019.2962024.
84
82
  """
85
83
 
86
84
  def __init__(self, system, config):
@@ -35,7 +35,7 @@ _prefix = r" - --------------> | " # NOQA
35
35
  _max_length = 80 # NOQA
36
36
 
37
37
  # NOTE: copyright
38
- copyright_msg = 'Copyright (C) 2023-2024 Jinning Wang'
38
+ copyright_msg = 'Copyright (C) 2023-2025 Jinning Wang'
39
39
 
40
40
  # NOTE: copied from CVXPY documentation, last checked on 2024/10/30, v1.5
41
41
  mip_solvers = ['CBC', 'COPT', 'GLPK_MI', 'CPLEX', 'GUROBI',
@@ -422,6 +422,13 @@ class System(andes_System):
422
422
  msg = f"Zero line rates detacted in {adjusted_rate}, "
423
423
  msg += f"adjusted to {default_rate}."
424
424
  logger.info(msg)
425
+ # Line max angle difference
426
+ if np.any(self.Line.amax.v == 0):
427
+ self.Line.amax.v[self.Line.amax.v == 0] = 2 * np.pi
428
+ logger.info("Zero line amax detected, adjusted to 2*pi.")
429
+ if np.any(self.Line.amin.v == 0):
430
+ self.Line.amin.v[self.Line.amin.v == 0] = -2 * np.pi
431
+ logger.info("Zero line amin detected, adjusted to -2*pi.")
425
432
  # === no device addition or removal after this point ===
426
433
  self.calc_pu_coeff() # calculate parameters in system per units
427
434
 
@@ -67,7 +67,7 @@ language = "en"
67
67
 
68
68
  # General information about the project.
69
69
  project = 'AMS'
70
- copyright = '2023-2024, Jinning Wang'
70
+ copyright = '2023-2025, Jinning Wang'
71
71
  author = 'Jinning Wang'
72
72
 
73
73
  version = ams.__version__
@@ -3,10 +3,6 @@
3
3
  Examples
4
4
  ========
5
5
 
6
- .. _`development demos`: https://github.com/CURENT/ams/tree/master/dev/demo
7
-
8
- Refer to the development `development demos`_ for examples prior to preparing this section.
9
-
10
6
  A collection of examples are presented to supplement the tutorial. The
11
7
  examples below are identical to the Jupyter Notebook in the ``examples``
12
8
  folder of the repository
@@ -9,6 +9,12 @@ The APIs before v3.0.0 are in beta and may change without prior notice.
9
9
  v1.0
10
10
  ==========
11
11
 
12
+ v1.0.6 (2024-04-10)
13
+ --------------------
14
+
15
+ - Enhance handling of Type 1 gencost: Automatically fallback to Type 2 gencost
16
+ - Add parameter correction for zero line angle difference
17
+
12
18
  v1.0.5 (2024-04-09)
13
19
  --------------------
14
20
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ltbams
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Python software for scheduling modeling and co-simulation with dynamics.
5
5
  Home-page: https://github.com/CURENT/ams
6
6
  Author: Jinning Wang
@@ -264,3 +264,30 @@ class TestCaseInit(unittest.TestCase):
264
264
 
265
265
  self.assertEqual(ss.EDES.exit_code, 0, "Exit code is not 0.")
266
266
  self.assertEqual(ss.UCES.exit_code, 0, "Exit code is not 0.")
267
+
268
+
269
+ class TestCase14(unittest.TestCase):
270
+ """
271
+ Test parameter correction using case14.m
272
+ """
273
+
274
+ def test_parameter_correction(self):
275
+ """
276
+ Test if the parameter correction works.
277
+ """
278
+ mpc = ams.io.matpower.m2mpc(get_case("matpower/case14.m"))
279
+ mpc['branch'][:, 11] = 0.0
280
+ mpc['branch'][:, 12] = 0.0
281
+
282
+ ss = ams.system.System()
283
+ ams.io.matpower.mpc2system(mpc, ss)
284
+ ss.setup()
285
+
286
+ # line rate
287
+ np.testing.assert_array_less(0.0, ss.Line.rate_a.v)
288
+ np.testing.assert_array_less(0.0, ss.Line.rate_b.v)
289
+ np.testing.assert_array_less(0.0, ss.Line.rate_c.v)
290
+
291
+ # line angle difference
292
+ np.testing.assert_array_less(0.0, ss.Line.amax.v)
293
+ np.testing.assert_array_less(ss.Line.amin.v, 0.0)
@@ -30,3 +30,12 @@ class TestMATPOWER(unittest.TestCase):
30
30
  # In case14.m, the gencost has type 2 cost model, with 3 parameters.
31
31
  np.testing.assert_array_less(np.zeros(system14.StaticGen.n),
32
32
  system14.GCost.c2.v,)
33
+
34
+ def test_gencost1(self):
35
+ """Test when gencost is type 1."""
36
+ mpcgc1 = self.mpc14.copy()
37
+ mpcgc1['gencost'] = np.repeat(np.array([[1, 0, 0, 3, 0.01, 40, 0]]), 5, axis=0)
38
+
39
+ system = ams.system.System()
40
+ ams.io.matpower.mpc2system(mpcgc1, system)
41
+ self.assertEqual(system.GCost.n, 5)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes