ltbams 1.0.8__py3-none-any.whl → 1.0.10__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/__init__.py +0 -1
- ams/_version.py +3 -3
- ams/cases/5bus/pjm5bus_demo.json +1324 -0
- ams/core/__init__.py +1 -0
- ams/core/common.py +30 -0
- ams/core/model.py +1 -1
- ams/core/symprocessor.py +1 -1
- ams/extension/eva.py +1 -1
- ams/interface.py +40 -24
- ams/io/matpower.py +192 -26
- ams/io/psse.py +278 -1
- ams/io/pypower.py +14 -0
- ams/main.py +2 -2
- ams/models/group.py +2 -70
- ams/models/static/pq.py +7 -3
- ams/opt/param.py +1 -2
- ams/report.py +3 -4
- ams/routines/__init__.py +2 -3
- ams/routines/acopf.py +5 -108
- ams/routines/dcopf.py +8 -0
- ams/routines/dcpf.py +1 -1
- ams/routines/ed.py +4 -2
- ams/routines/grbopt.py +150 -0
- ams/routines/pflow.py +2 -2
- ams/routines/pypower.py +631 -0
- ams/routines/routine.py +4 -10
- ams/routines/uc.py +2 -2
- ams/shared.py +30 -44
- ams/system.py +118 -2
- docs/source/api.rst +2 -0
- docs/source/getting_started/formats/matpower.rst +135 -0
- docs/source/getting_started/formats/pypower.rst +1 -2
- docs/source/getting_started/install.rst +9 -6
- docs/source/images/dcopf_time.png +0 -0
- docs/source/images/educ_pie.png +0 -0
- docs/source/release-notes.rst +29 -47
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/METADATA +87 -47
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/RECORD +58 -75
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/WHEEL +1 -1
- tests/test_1st_system.py +1 -1
- tests/test_case.py +14 -14
- tests/test_export_csv.py +1 -1
- tests/test_interface.py +24 -2
- tests/test_io.py +125 -1
- tests/test_omodel.py +1 -1
- tests/test_report.py +6 -6
- tests/test_routine.py +2 -2
- tests/test_rtn_acopf.py +75 -0
- tests/test_rtn_dcopf.py +1 -1
- tests/test_rtn_dcopf2.py +1 -1
- tests/test_rtn_ed.py +9 -9
- tests/test_rtn_opf.py +142 -0
- tests/test_rtn_pflow.py +0 -72
- tests/test_rtn_pypower.py +315 -0
- tests/test_rtn_rted.py +8 -8
- tests/test_rtn_uc.py +18 -18
- ams/pypower/__init__.py +0 -8
- ams/pypower/_compat.py +0 -9
- ams/pypower/core/__init__.py +0 -8
- ams/pypower/core/pips.py +0 -894
- ams/pypower/core/ppoption.py +0 -244
- ams/pypower/core/ppver.py +0 -18
- ams/pypower/core/solver.py +0 -2451
- ams/pypower/eps.py +0 -6
- ams/pypower/idx.py +0 -174
- ams/pypower/io.py +0 -604
- ams/pypower/make/__init__.py +0 -11
- ams/pypower/make/matrices.py +0 -665
- ams/pypower/make/pdv.py +0 -506
- ams/pypower/routines/__init__.py +0 -7
- ams/pypower/routines/cpf.py +0 -513
- ams/pypower/routines/cpf_callbacks.py +0 -114
- ams/pypower/routines/opf.py +0 -1803
- ams/pypower/routines/opffcns.py +0 -1946
- ams/pypower/routines/pflow.py +0 -852
- ams/pypower/toggle.py +0 -1098
- ams/pypower/utils.py +0 -293
- ams/routines/cpf.py +0 -65
- ams/routines/dcpf0.py +0 -196
- ams/routines/pflow0.py +0 -113
- tests/test_rtn_dcpf.py +0 -77
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/entry_points.txt +0 -0
- {ltbams-1.0.8.dist-info → ltbams-1.0.10.dist-info}/top_level.txt +0 -0
tests/test_rtn_dcpf.py
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
import unittest
|
2
|
-
|
3
|
-
import ams
|
4
|
-
|
5
|
-
|
6
|
-
class TestDCPF(unittest.TestCase):
|
7
|
-
"""
|
8
|
-
Test routine `DCPF`.
|
9
|
-
"""
|
10
|
-
|
11
|
-
def setUp(self) -> None:
|
12
|
-
self.ss = ams.load(ams.get_case("5bus/pjm5bus_demo.xlsx"),
|
13
|
-
setup=True, default_config=True, no_output=True)
|
14
|
-
# decrease load first
|
15
|
-
self.ss.PQ.set(src='p0', attr='v', idx=['PQ_1', 'PQ_2'], value=[0.3, 0.3])
|
16
|
-
|
17
|
-
def test_init(self):
|
18
|
-
"""
|
19
|
-
Test initialization.
|
20
|
-
"""
|
21
|
-
self.ss.DCPF.init()
|
22
|
-
self.assertTrue(self.ss.DCPF.initialized, "DCPF initialization failed!")
|
23
|
-
|
24
|
-
def test_trip_gen(self):
|
25
|
-
"""
|
26
|
-
Test generator tripping.
|
27
|
-
"""
|
28
|
-
stg = 'PV_1'
|
29
|
-
self.ss.StaticGen.set(src='u', idx=stg, attr='v', value=0)
|
30
|
-
|
31
|
-
self.ss.DCPF.update()
|
32
|
-
self.ss.DCPF.run(solver='CLARABEL')
|
33
|
-
self.assertTrue(self.ss.DCPF.converged, "DCPF did not converge under generator trip!")
|
34
|
-
self.assertAlmostEqual(self.ss.DCPF.get(src='pg', attr='v', idx=stg),
|
35
|
-
0, places=6,
|
36
|
-
msg="Generator trip does not take effect!")
|
37
|
-
|
38
|
-
self.ss.StaticGen.set(src='u', idx=stg, attr='v', value=1) # reset
|
39
|
-
|
40
|
-
def test_trip_line(self):
|
41
|
-
"""
|
42
|
-
Test line tripping.
|
43
|
-
"""
|
44
|
-
self.ss.Line.set(src='u', attr='v', idx='Line_3', value=0)
|
45
|
-
|
46
|
-
self.ss.DCPF.update()
|
47
|
-
self.ss.DCPF.run(solver='CLARABEL')
|
48
|
-
self.assertTrue(self.ss.DCPF.converged, "DCPF did not converge under line trip!")
|
49
|
-
self.assertAlmostEqual(self.ss.DCPF.get(src='plf', attr='v', idx='Line_3'),
|
50
|
-
0, places=6,
|
51
|
-
msg="Line trip does not take effect!")
|
52
|
-
|
53
|
-
self.ss.Line.alter(src='u', idx='Line_3', value=1) # reset
|
54
|
-
|
55
|
-
def test_set_load(self):
|
56
|
-
"""
|
57
|
-
Test setting and tripping load.
|
58
|
-
"""
|
59
|
-
# --- run DCPF ---
|
60
|
-
self.ss.DCPF.run(solver='CLARABEL')
|
61
|
-
pgs = self.ss.DCPF.pg.v.sum()
|
62
|
-
|
63
|
-
# --- set load ---
|
64
|
-
self.ss.PQ.set(src='p0', attr='v', idx='PQ_1', value=0.1)
|
65
|
-
self.ss.DCPF.update()
|
66
|
-
|
67
|
-
self.ss.DCPF.run(solver='CLARABEL')
|
68
|
-
pgs_pqt = self.ss.DCPF.pg.v.sum()
|
69
|
-
self.assertLess(pgs_pqt, pgs, "Load set does not take effect!")
|
70
|
-
|
71
|
-
# --- trip load ---
|
72
|
-
self.ss.PQ.set(src='u', attr='v', idx='PQ_2', value=0)
|
73
|
-
self.ss.DCPF.update()
|
74
|
-
|
75
|
-
self.ss.DCPF.run(solver='CLARABEL')
|
76
|
-
pgs_pqt2 = self.ss.DCPF.pg.v.sum()
|
77
|
-
self.assertLess(pgs_pqt2, pgs_pqt, "Load trip does not take effect!")
|
File without changes
|
File without changes
|