ltbams 1.0.5__py3-none-any.whl → 1.0.6__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.
- ams/_version.py +3 -3
- ams/io/matpower.py +7 -0
- ams/models/cost.py +2 -0
- ams/routines/dcopf.py +5 -5
- ams/routines/dcopf2.py +2 -2
- ams/routines/ed.py +2 -3
- ams/routines/uc.py +4 -6
- ams/shared.py +1 -1
- ams/system.py +7 -0
- docs/source/conf.py +1 -1
- docs/source/examples/index.rst +0 -4
- docs/source/release-notes.rst +6 -0
- {ltbams-1.0.5.dist-info → ltbams-1.0.6.dist-info}/METADATA +1 -1
- {ltbams-1.0.5.dist-info → ltbams-1.0.6.dist-info}/RECORD +19 -19
- tests/test_case.py +27 -0
- tests/test_io.py +9 -0
- {ltbams-1.0.5.dist-info → ltbams-1.0.6.dist-info}/WHEEL +0 -0
- {ltbams-1.0.5.dist-info → ltbams-1.0.6.dist-info}/entry_points.txt +0 -0
- {ltbams-1.0.5.dist-info → ltbams-1.0.6.dist-info}/top_level.txt +0 -0
ams/_version.py
CHANGED
@@ -8,11 +8,11 @@ import json
|
|
8
8
|
|
9
9
|
version_json = '''
|
10
10
|
{
|
11
|
-
"date": "2025-04-
|
11
|
+
"date": "2025-04-10T23:17:16-0400",
|
12
12
|
"dirty": false,
|
13
13
|
"error": null,
|
14
|
-
"full-revisionid": "
|
15
|
-
"version": "1.0.
|
14
|
+
"full-revisionid": "3dbdbfee9ce8361b7975c9333179b88c01560137",
|
15
|
+
"version": "1.0.6"
|
16
16
|
}
|
17
17
|
''' # END VERSION_JSON
|
18
18
|
|
ams/io/matpower.py
CHANGED
@@ -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
|
ams/models/cost.py
CHANGED
@@ -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,)
|
ams/routines/dcopf.py
CHANGED
@@ -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
|
-
|
26
|
-
|
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
|
31
|
-
|
32
|
-
|
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):
|
ams/routines/dcopf2.py
CHANGED
@@ -25,8 +25,8 @@ class DCOPF2(DCOPF):
|
|
25
25
|
Notes
|
26
26
|
-----
|
27
27
|
1. This routine requires PTDF matrix.
|
28
|
-
|
29
|
-
|
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):
|
ams/routines/ed.py
CHANGED
@@ -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
|
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.
|
126
|
+
3. ``EDTSlot.ug`` is used instead of ``StaticGen.u`` for generator commitment.
|
128
127
|
"""
|
129
128
|
|
130
129
|
def __init__(self, system, config):
|
ams/routines/uc.py
CHANGED
@@ -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
|
-
|
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
|
-
|
83
|
-
|
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):
|
ams/shared.py
CHANGED
@@ -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-
|
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',
|
ams/system.py
CHANGED
@@ -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
|
|
docs/source/conf.py
CHANGED
docs/source/examples/index.rst
CHANGED
@@ -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
|
docs/source/release-notes.rst
CHANGED
@@ -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,12 +1,12 @@
|
|
1
1
|
ams/__init__.py,sha256=dKIwng8xES4NQHn6ZHy8RCKeXphN9z2wyfmbvniIEg0,351
|
2
2
|
ams/__main__.py,sha256=EB4GfGiKgvnQ_psNr0QwPoziYvjmGvQ2yVsBwQtfrLw,170
|
3
|
-
ams/_version.py,sha256=
|
3
|
+
ams/_version.py,sha256=oAzDdazRg63AUA2MukEv3uZGF9tr0x-lHYUi17sP_Bg,497
|
4
4
|
ams/cli.py,sha256=EyNFXn565gFCppTxpyTZviBdPgUuKtgAPZ4WE6xewRk,6164
|
5
5
|
ams/interface.py,sha256=PCR9geO-pvCxXxljWP4u3M-BAdVD5DjA3xvf338g9x8,44487
|
6
6
|
ams/main.py,sha256=wzKLe_BeQAUyFh-U1cxQIOwr-rAJM8ppB3EEi6_v2tw,23607
|
7
7
|
ams/report.py,sha256=gUscOYpPjuPuruzIXAADaifIZv2BSjmP1oKCuHdD3Vw,11004
|
8
|
-
ams/shared.py,sha256=
|
9
|
-
ams/system.py,sha256=
|
8
|
+
ams/shared.py,sha256=yaO4RUD0T-zCcZeML20vORcaf_dXiwMAvjTriXz1xtg,4159
|
9
|
+
ams/system.py,sha256=5P0DZ7eEqQ8yQL_JBEMDYpr5N7QKHB2X5aJOvEkjiv4,26307
|
10
10
|
ams/cases/5bus/pjm5bus_demo.xlsx,sha256=srKTX4AkDRUVg_ygChyrQjeX7o0KKPJ9q9zU69xJqdU,31112
|
11
11
|
ams/cases/5bus/pjm5bus_jumper.xlsx,sha256=IfcSZ3V2ZgfFqpaPMBMqitUQMgoxKRnyFyMEtqdeysI,28375
|
12
12
|
ams/cases/5bus/pjm5bus_uced.json,sha256=0RvkZwZwzXKqr8y9shjEr3qCPGlrBrh6VpGhvYa4pMM,18256
|
@@ -48,14 +48,14 @@ ams/extension/__init__.py,sha256=5IFTNirDL0uDaUsg05_oociVT9VCy2rhPx1ad4LGveM,65
|
|
48
48
|
ams/extension/eva.py,sha256=wUF8RNxzwas2Q6_xD0k3EVWjmX4kxHmTSkv2inJzaUY,16342
|
49
49
|
ams/io/__init__.py,sha256=HLE3aozzXEx-6IBy8WTQVdSCpAZrrR9nX6UqaZ7okTw,3774
|
50
50
|
ams/io/json.py,sha256=IurwcZDuKczSbRTpcbQZiIi0ARCrMK6kJ0E3wS8ENy8,2585
|
51
|
-
ams/io/matpower.py,sha256=
|
51
|
+
ams/io/matpower.py,sha256=Oj3FW-eqcl3H5mnB0U5XG1mtCK0SaxVOkgRXaC6MIKA,14523
|
52
52
|
ams/io/psse.py,sha256=w5VKNE6enX0lfKwPI857PRtdpwN39R6IFRIcdbPSpOg,151
|
53
53
|
ams/io/pypower.py,sha256=E6_kSNfv1Yyv9oYfFebeNeKaQPlHyRZQpE8F6Y67g8Q,2583
|
54
54
|
ams/io/xlsx.py,sha256=7ATW1seyxsGn7d5p5IuSRFHcoCHVVjMu3E7mP1Mc74U,2460
|
55
55
|
ams/models/__init__.py,sha256=Y1Igq3AByDI6QjqjWxNDMeTAa2-fdnk2ZX5HtdJO6lY,703
|
56
56
|
ams/models/area.py,sha256=AKYU6aJQKsVWRZdvMO7yic-8wZ1GumSTQXgDg5L0THw,899
|
57
57
|
ams/models/bus.py,sha256=U0vSegkm-9fqPQS9KMJQU6gpIMX_1GK5O_dvRc8-0P0,1585
|
58
|
-
ams/models/cost.py,sha256=
|
58
|
+
ams/models/cost.py,sha256=rmGNj9ztMbqA-OIJj8fNNBh8bdYJSY9hk10vffgxc6k,5916
|
59
59
|
ams/models/group.py,sha256=byAp-sfsS7WhCL8L9y6wqljO6zO_u_JomgIv4syvbJA,5602
|
60
60
|
ams/models/info.py,sha256=Oh0Xo5J4ZHBsNIkMOzIwv_DegsX1inyuv3Q5CpCfyQw,788
|
61
61
|
ams/models/line.py,sha256=6t0_Y6rlD8riHiljThwluiZMtshu9kgd9ti_Px81KgU,8083
|
@@ -105,34 +105,34 @@ ams/pypower/routines/pflow.py,sha256=q5RFZ5XuB5YQZk1jpJ5aTUB3DfgPJEGsvWyLDNo5PJo
|
|
105
105
|
ams/routines/__init__.py,sha256=idfPyMhFr0hkUZjcAEQw14JA5zPHeFe3Vl3p4DCJ5d0,640
|
106
106
|
ams/routines/acopf.py,sha256=VZC3qs1G7zE--6XxE_wXv432nj3SV5hcrR8967ogYlg,3835
|
107
107
|
ams/routines/cpf.py,sha256=xsrUVjtGQ1b7UCXpwwYihqzTeEGJJKnO9LlX1Tz9Tks,1552
|
108
|
-
ams/routines/dcopf.py,sha256=
|
109
|
-
ams/routines/dcopf2.py,sha256=
|
108
|
+
ams/routines/dcopf.py,sha256=PWAd0xRpgTDysG6OMRVMkBGtUEyjvmmSt8758tXajOw,11091
|
109
|
+
ams/routines/dcopf2.py,sha256=sDCP8zqYHDh7s7p9SX6G8QhMfIxCg3VPYJn6r3pRKyo,3620
|
110
110
|
ams/routines/dcpf.py,sha256=SswIb7t37ulxe1rjroA7oSa6z01kYjO-x8P1WWOUutM,8237
|
111
111
|
ams/routines/dcpf0.py,sha256=gPPfSUzzJbHz_gAEFVyZ3iriEHvLJ-OGpTzhza8FOkA,6811
|
112
112
|
ams/routines/dopf.py,sha256=yIn4tdxgb_phdvlHn4kMT9dUP0c_0Lu5kFfyCAUG-tk,6241
|
113
|
-
ams/routines/ed.py,sha256=
|
113
|
+
ams/routines/ed.py,sha256=eAgAbcnqyqR4UdhlV1VHTu6m99slAZSeEeGvkDp8BXs,11648
|
114
114
|
ams/routines/pflow.py,sha256=I4lyXDyprkg_0j3gY5bdkkBA5ImSjnouMzRnuG1yKb8,9435
|
115
115
|
ams/routines/pflow0.py,sha256=xocLw94jcl2hh3WwnS_mdUW6dsm3EVjvZptVb814GdE,3521
|
116
116
|
ams/routines/routine.py,sha256=I98uMg6QCt6bipNYwdgtNMbdw_gWCSNVGokS4UmvkSk,35932
|
117
117
|
ams/routines/rted.py,sha256=BWq2XCYP99siBiLNMF0oKiUmxsCAypBPYxTNeCsjz8Y,22197
|
118
118
|
ams/routines/type.py,sha256=lvTWSnCYIbRJXIm3HX6jA0Hv-WWYusTOUPfoW8DITlU,3877
|
119
|
-
ams/routines/uc.py,sha256=
|
119
|
+
ams/routines/uc.py,sha256=KeKuvd6xxRQTvRiJA7MSOUUVKO5_c5654gOms3mGS9M,15632
|
120
120
|
ams/utils/__init__.py,sha256=2hAQmWRgmnE-bCGT9cJoW9FkPDMGRiGkbBcUgj-bgjI,122
|
121
121
|
ams/utils/misc.py,sha256=Y6tPKpUKJa7bL9alroJuG2UNW9vdQjnfAmKb2EbIls8,2027
|
122
122
|
ams/utils/paths.py,sha256=D9VNUwtJtHy-8PFzMnxtQ9HpkOXT6vdVOjfOTuoKGKw,6699
|
123
123
|
docs/Makefile,sha256=UKXBFAbKGPt1Xw9J84343v0Mh8ylAZ-tE0uCd74DrQU,725
|
124
124
|
docs/make.bat,sha256=9UgKGb4SdP006622fJiFxeFT1BeycYAs6hDbV1xwPy8,804
|
125
125
|
docs/source/api.rst,sha256=gDix4Vg_SNUqtijlSmfBktpOrWQMdaj4xsBKrO22dfw,1402
|
126
|
-
docs/source/conf.py,sha256=
|
126
|
+
docs/source/conf.py,sha256=UyoWogZTUNSJU7pQS_JaR28nKddW94zr01LYoIciZZw,6688
|
127
127
|
docs/source/genmodelref.py,sha256=IhmF7bDw8BXPvLD8V3WjQNrfc-H07r5iS-_4DHbbp-8,1420
|
128
128
|
docs/source/genroutineref.py,sha256=0JyMc2kV5bWrWbSoO6d7o4QgDgG8mVy3JGGQWacJypw,1064
|
129
129
|
docs/source/index.rst,sha256=N5phQS5RIyYs-NZo_5yYB8LjvHzOKLeXzRA-M8i-g3Q,2688
|
130
|
-
docs/source/release-notes.rst,sha256=
|
130
|
+
docs/source/release-notes.rst,sha256=UbY9PEvwT9Z70IvdOU34YI7dQ4MTSfHWz9yZamN5euA,13305
|
131
131
|
docs/source/_templates/autosummary/base.rst,sha256=zl3U4baR4a6YjsHyT-x9zCOrHwKZOVUdWn1NPX2u3bc,106
|
132
132
|
docs/source/_templates/autosummary/class.rst,sha256=Hv_igCsLsUpM62_zN0nqj6FSfKnS5xLyu8ZldMbfOAk,668
|
133
133
|
docs/source/_templates/autosummary/module.rst,sha256=YdbpCudOrEU-JbuSlzGvcOI2hn_KrCM6FW5HcGqkaEE,1113
|
134
134
|
docs/source/_templates/autosummary/module_toctree.rst,sha256=sg30OdqFDLyo8Y3hl9V-s2BXb1bzcjjqqWaWi-C3qFM,1126
|
135
|
-
docs/source/examples/index.rst,sha256=
|
135
|
+
docs/source/examples/index.rst,sha256=6VT3wVeKk8BWf6pJQtZrmcumW_3jI8esdlzja8scUCA,742
|
136
136
|
docs/source/getting_started/copyright.rst,sha256=XBfWvLm7T8p-zh1jkDy1kODvTDcH73AEV_vkiN32A2o,715
|
137
137
|
docs/source/getting_started/index.rst,sha256=mcp1NdUwbPoNzpn7Owf5Qzfd6J_--ToU52PjmrbwjBY,1512
|
138
138
|
docs/source/getting_started/install.rst,sha256=gE4L0ApiC_mwbjbYtkGW4ilyIAu_Jn-VIeoYlgRiOIw,7268
|
@@ -160,12 +160,12 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
160
160
|
tests/test_1st_system.py,sha256=5PQgI1DeM5yQTFagOPCMbk0eItTH6-M6FC8TMCv-CRY,1007
|
161
161
|
tests/test_addressing.py,sha256=MIT713KCqMg0h2o4rBDZsGUrpGadmMlXnrrdq-wB77E,1364
|
162
162
|
tests/test_andes_mats.py,sha256=3JQ2xK5B4s42EHxjCcUjJbt1VY3rZPwjkq81ubFlsLQ,1674
|
163
|
-
tests/test_case.py,sha256=
|
163
|
+
tests/test_case.py,sha256=zkf5jT314e97Rx_PJXCwmuvaeQDTjJ42zYR6WwJetxE,8606
|
164
164
|
tests/test_cli.py,sha256=TtCGBy2e7Ll_2gJTFo9juZtzhaakho_MqkcqhG2w2dk,870
|
165
165
|
tests/test_export_csv.py,sha256=rZCafNrVbwDo7ZNC4MrL1gIcrU0c6YVw2q-QGL3O4K4,2921
|
166
166
|
tests/test_group.py,sha256=Tq0s9gtenqrv4ws5YNzWxbiF4WgyhtMEAXZfJtew6M4,2699
|
167
167
|
tests/test_interface.py,sha256=lXKR8OAsGIg5dV2Uj0UwGAl69hKnc_7EtCYvpP_0rrU,8157
|
168
|
-
tests/test_io.py,sha256=
|
168
|
+
tests/test_io.py,sha256=LaNkRXZaItAFHqqXs6CC5iaxTMXiDEFGbwYODcOHPWc,1416
|
169
169
|
tests/test_jumper.py,sha256=bdOknplEGnO_tiJc7p3xQvgTe2b6Dz53bOgbFaXKMAI,537
|
170
170
|
tests/test_known_good.py,sha256=NBrlAxnVMxIHXR2cWps-Kwjh36fiU4Y-eupspZkM0ks,9670
|
171
171
|
tests/test_matp.py,sha256=LkjhqxSFr6oY_ENpduDQ77rhLLBl6RzIHZ2d0m_8i-8,17262
|
@@ -183,8 +183,8 @@ tests/test_rtn_pflow.py,sha256=aDL5Ewm6lWqpdHqIIu-DTllhXzt4bMjsLJaKbJa8sXQ,6990
|
|
183
183
|
tests/test_rtn_rted.py,sha256=AyW5B4A51L_nIVLX1eYeu9ZUboOh1CH2FVj2C1XJjSc,9769
|
184
184
|
tests/test_rtn_uc.py,sha256=vdG2ss3q91CXLZ2sUgzoUr1NU-63ue7nOxAYywMordE,8286
|
185
185
|
tests/test_service.py,sha256=8YIa_PXurwgOzsWvUqoyqS_AzlpdrKHIMxAln5fIqCU,2438
|
186
|
-
ltbams-1.0.
|
187
|
-
ltbams-1.0.
|
188
|
-
ltbams-1.0.
|
189
|
-
ltbams-1.0.
|
190
|
-
ltbams-1.0.
|
186
|
+
ltbams-1.0.6.dist-info/METADATA,sha256=HPawZwqPMnM1vtyrVEA_yU8FDcs47BdNv_zJTaYy5uo,14023
|
187
|
+
ltbams-1.0.6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
188
|
+
ltbams-1.0.6.dist-info/entry_points.txt,sha256=FA56FlhO_yVNeEf810SrorVQb7_Xsmo3_EW-W-ijUfA,37
|
189
|
+
ltbams-1.0.6.dist-info/top_level.txt,sha256=pyKDqG2kj13F9-BYd_wkruRdBSqLXw8Nwc-cmljqrxg,15
|
190
|
+
ltbams-1.0.6.dist-info/RECORD,,
|
tests/test_case.py
CHANGED
@@ -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)
|
tests/test_io.py
CHANGED
@@ -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
|