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.
- ams/__init__.py +4 -11
- ams/_version.py +3 -3
- ams/cases/5bus/pjm5bus_demo.xlsx +0 -0
- ams/cases/5bus/pjm5bus_jumper.xlsx +0 -0
- ams/cases/5bus/pjm5bus_uced.json +1062 -0
- ams/cases/5bus/pjm5bus_uced.xlsx +0 -0
- ams/cases/5bus/pjm5bus_uced_esd1.xlsx +0 -0
- ams/cases/5bus/pjm5bus_uced_ev.xlsx +0 -0
- ams/cases/ieee123/ieee123.xlsx +0 -0
- ams/cases/ieee123/ieee123_regcv1.xlsx +0 -0
- ams/cases/ieee14/ieee14.json +1166 -0
- ams/cases/ieee14/ieee14.raw +92 -0
- ams/cases/ieee14/ieee14_conn.xlsx +0 -0
- ams/cases/ieee14/ieee14_uced.xlsx +0 -0
- ams/cases/ieee39/ieee39.xlsx +0 -0
- ams/cases/ieee39/ieee39_uced.xlsx +0 -0
- ams/cases/ieee39/ieee39_uced_esd1.xlsx +0 -0
- ams/cases/ieee39/ieee39_uced_pvd1.xlsx +0 -0
- ams/cases/ieee39/ieee39_uced_vis.xlsx +0 -0
- ams/cases/matpower/benchmark.json +1594 -0
- ams/cases/matpower/case118.m +787 -0
- ams/cases/matpower/case14.m +129 -0
- ams/cases/matpower/case300.m +1315 -0
- ams/cases/matpower/case39.m +205 -0
- ams/cases/matpower/case5.m +62 -0
- ams/cases/matpower/case_ACTIVSg2000.m +9460 -0
- ams/cases/npcc/npcc.m +644 -0
- ams/cases/npcc/npcc_uced.xlsx +0 -0
- ams/cases/pglib/pglib_opf_case39_epri__api.m +243 -0
- ams/cases/wecc/wecc.m +714 -0
- ams/cases/wecc/wecc_uced.xlsx +0 -0
- ams/cli.py +6 -0
- ams/core/__init__.py +2 -0
- ams/core/documenter.py +652 -0
- ams/core/matprocessor.py +782 -0
- ams/core/model.py +330 -0
- ams/core/param.py +322 -0
- ams/core/service.py +918 -0
- ams/core/symprocessor.py +224 -0
- ams/core/var.py +59 -0
- ams/extension/__init__.py +5 -0
- ams/extension/eva.py +401 -0
- ams/interface.py +1085 -0
- ams/io/__init__.py +133 -0
- ams/io/json.py +82 -0
- ams/io/matpower.py +406 -0
- ams/io/psse.py +6 -0
- ams/io/pypower.py +103 -0
- ams/io/xlsx.py +80 -0
- ams/main.py +81 -4
- ams/models/__init__.py +24 -0
- ams/models/area.py +40 -0
- ams/models/bus.py +52 -0
- ams/models/cost.py +169 -0
- ams/models/distributed/__init__.py +3 -0
- ams/models/distributed/esd1.py +71 -0
- ams/models/distributed/ev.py +60 -0
- ams/models/distributed/pvd1.py +67 -0
- ams/models/group.py +231 -0
- ams/models/info.py +26 -0
- ams/models/line.py +238 -0
- ams/models/renewable/__init__.py +5 -0
- ams/models/renewable/regc.py +119 -0
- ams/models/reserve.py +94 -0
- ams/models/shunt.py +14 -0
- ams/models/static/__init__.py +2 -0
- ams/models/static/gen.py +165 -0
- ams/models/static/pq.py +61 -0
- ams/models/timeslot.py +69 -0
- ams/models/zone.py +49 -0
- ams/opt/__init__.py +12 -0
- ams/opt/constraint.py +175 -0
- ams/opt/exprcalc.py +127 -0
- ams/opt/expression.py +188 -0
- ams/opt/objective.py +174 -0
- ams/opt/omodel.py +432 -0
- ams/opt/optzbase.py +192 -0
- ams/opt/param.py +156 -0
- ams/opt/var.py +233 -0
- ams/pypower/__init__.py +8 -0
- ams/pypower/_compat.py +9 -0
- ams/pypower/core/__init__.py +8 -0
- ams/pypower/core/pips.py +894 -0
- ams/pypower/core/ppoption.py +244 -0
- ams/pypower/core/ppver.py +18 -0
- ams/pypower/core/solver.py +2451 -0
- ams/pypower/eps.py +6 -0
- ams/pypower/idx.py +174 -0
- ams/pypower/io.py +604 -0
- ams/pypower/make/__init__.py +11 -0
- ams/pypower/make/matrices.py +665 -0
- ams/pypower/make/pdv.py +506 -0
- ams/pypower/routines/__init__.py +7 -0
- ams/pypower/routines/cpf.py +513 -0
- ams/pypower/routines/cpf_callbacks.py +114 -0
- ams/pypower/routines/opf.py +1803 -0
- ams/pypower/routines/opffcns.py +1946 -0
- ams/pypower/routines/pflow.py +852 -0
- ams/pypower/toggle.py +1098 -0
- ams/pypower/utils.py +293 -0
- ams/report.py +212 -50
- ams/routines/__init__.py +23 -0
- ams/routines/acopf.py +117 -0
- ams/routines/cpf.py +65 -0
- ams/routines/dcopf.py +241 -0
- ams/routines/dcpf.py +209 -0
- ams/routines/dcpf0.py +196 -0
- ams/routines/dopf.py +150 -0
- ams/routines/ed.py +312 -0
- ams/routines/pflow.py +255 -0
- ams/routines/pflow0.py +113 -0
- ams/routines/routine.py +1033 -0
- ams/routines/rted.py +519 -0
- ams/routines/type.py +160 -0
- ams/routines/uc.py +376 -0
- ams/shared.py +63 -9
- ams/system.py +61 -22
- ams/utils/__init__.py +3 -0
- ams/utils/misc.py +77 -0
- ams/utils/paths.py +257 -0
- docs/Makefile +21 -0
- docs/make.bat +35 -0
- docs/source/_templates/autosummary/base.rst +5 -0
- docs/source/_templates/autosummary/class.rst +35 -0
- docs/source/_templates/autosummary/module.rst +65 -0
- docs/source/_templates/autosummary/module_toctree.rst +66 -0
- docs/source/api.rst +102 -0
- docs/source/conf.py +203 -0
- docs/source/examples/index.rst +34 -0
- docs/source/genmodelref.py +61 -0
- docs/source/genroutineref.py +47 -0
- docs/source/getting_started/copyright.rst +20 -0
- docs/source/getting_started/formats/index.rst +20 -0
- docs/source/getting_started/formats/matpower.rst +183 -0
- docs/source/getting_started/formats/psse.rst +46 -0
- docs/source/getting_started/formats/pypower.rst +223 -0
- docs/source/getting_started/formats/xlsx.png +0 -0
- docs/source/getting_started/formats/xlsx.rst +23 -0
- docs/source/getting_started/index.rst +76 -0
- docs/source/getting_started/install.rst +234 -0
- docs/source/getting_started/overview.rst +26 -0
- docs/source/getting_started/testcase.rst +45 -0
- docs/source/getting_started/verification.rst +13 -0
- docs/source/images/curent.ico +0 -0
- docs/source/images/dcopf_time.png +0 -0
- docs/source/images/sponsors/CURENT_Logo_NameOnTrans.png +0 -0
- docs/source/images/sponsors/CURENT_Logo_Transparent.png +0 -0
- docs/source/images/sponsors/CURENT_Logo_Transparent_Name.png +0 -0
- docs/source/images/sponsors/doe.png +0 -0
- docs/source/index.rst +108 -0
- docs/source/modeling/example.rst +159 -0
- docs/source/modeling/index.rst +17 -0
- docs/source/modeling/model.rst +210 -0
- docs/source/modeling/routine.rst +122 -0
- docs/source/modeling/system.rst +51 -0
- docs/source/release-notes.rst +398 -0
- ltbams-1.0.2a1.dist-info/METADATA +210 -0
- ltbams-1.0.2a1.dist-info/RECORD +188 -0
- {ltbams-0.9.9.dist-info → ltbams-1.0.2a1.dist-info}/WHEEL +1 -1
- ltbams-1.0.2a1.dist-info/top_level.txt +3 -0
- tests/__init__.py +0 -0
- tests/test_1st_system.py +33 -0
- tests/test_addressing.py +40 -0
- tests/test_andes_mats.py +61 -0
- tests/test_case.py +266 -0
- tests/test_cli.py +34 -0
- tests/test_export_csv.py +89 -0
- tests/test_group.py +83 -0
- tests/test_interface.py +216 -0
- tests/test_io.py +32 -0
- tests/test_jumper.py +27 -0
- tests/test_known_good.py +267 -0
- tests/test_matp.py +437 -0
- tests/test_model.py +54 -0
- tests/test_omodel.py +119 -0
- tests/test_paths.py +22 -0
- tests/test_report.py +251 -0
- tests/test_repr.py +21 -0
- tests/test_routine.py +178 -0
- tests/test_rtn_dcopf.py +101 -0
- tests/test_rtn_dcpf.py +77 -0
- tests/test_rtn_ed.py +279 -0
- tests/test_rtn_pflow.py +219 -0
- tests/test_rtn_rted.py +273 -0
- tests/test_rtn_uc.py +248 -0
- tests/test_service.py +73 -0
- ltbams-0.9.9.dist-info/LICENSE +0 -692
- ltbams-0.9.9.dist-info/METADATA +0 -859
- ltbams-0.9.9.dist-info/RECORD +0 -14
- ltbams-0.9.9.dist-info/top_level.txt +0 -1
- {ltbams-0.9.9.dist-info → ltbams-1.0.2a1.dist-info}/entry_points.txt +0 -0
ams/utils/misc.py
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
import warnings
|
2
|
+
import functools
|
3
|
+
|
4
|
+
from andes.utils.misc import elapsed
|
5
|
+
|
6
|
+
|
7
|
+
def timer(func):
|
8
|
+
def wrapper(*args, **kwargs):
|
9
|
+
t0, _ = elapsed()
|
10
|
+
result = func(*args, **kwargs)
|
11
|
+
_, s = elapsed(t0)
|
12
|
+
return result, s
|
13
|
+
return wrapper
|
14
|
+
|
15
|
+
|
16
|
+
def create_entry(*fields, three_params=True):
|
17
|
+
"""
|
18
|
+
Helper function to create a list of fields for a model entry.
|
19
|
+
|
20
|
+
Parameters
|
21
|
+
----------
|
22
|
+
fields : tuple
|
23
|
+
Additional fields to include in the list.
|
24
|
+
three_params : bool, optional
|
25
|
+
Whether to include 'idx', 'u', 'name' in the list (default is True).
|
26
|
+
|
27
|
+
Returns
|
28
|
+
-------
|
29
|
+
list
|
30
|
+
A list of fields for the model entry.
|
31
|
+
"""
|
32
|
+
base_fields = ['idx', 'u', 'name'] if three_params else []
|
33
|
+
return base_fields + list(fields)
|
34
|
+
|
35
|
+
|
36
|
+
def pretty_long_message(message, prefix="", max_length=80):
|
37
|
+
"""
|
38
|
+
Pretty print a long message.
|
39
|
+
|
40
|
+
Parameters
|
41
|
+
----------
|
42
|
+
message : str
|
43
|
+
The message to format.
|
44
|
+
prefix : str, optional
|
45
|
+
A prefix to add to each line of the message.
|
46
|
+
max_length : int, optional
|
47
|
+
The maximum length of each line.
|
48
|
+
|
49
|
+
Returns
|
50
|
+
-------
|
51
|
+
str
|
52
|
+
The formatted message.
|
53
|
+
"""
|
54
|
+
if len(message) <= max_length:
|
55
|
+
return message
|
56
|
+
else:
|
57
|
+
lines = [message[i:i+max_length] for i in range(0, len(message), max_length)]
|
58
|
+
formatted_message = lines[0] + "\n" + "\n".join([prefix + line for line in lines[1:]])
|
59
|
+
return formatted_message
|
60
|
+
|
61
|
+
|
62
|
+
def deprecated(message="This function is deprecated and will be removed in a future version."):
|
63
|
+
def decorator(func):
|
64
|
+
@functools.wraps(func)
|
65
|
+
def wrapper(*args, **kwargs):
|
66
|
+
warnings.warn(
|
67
|
+
message,
|
68
|
+
category=DeprecationWarning,
|
69
|
+
stacklevel=2
|
70
|
+
)
|
71
|
+
return func(*args, **kwargs)
|
72
|
+
return wrapper
|
73
|
+
return decorator
|
74
|
+
|
75
|
+
|
76
|
+
deprec_get_idx = deprecated(
|
77
|
+
"get_idx() is deprecated and will be removed in a future version. Please use get_all_idxes() instead.")
|
ams/utils/paths.py
ADDED
@@ -0,0 +1,257 @@
|
|
1
|
+
"""
|
2
|
+
Utility functions for loading ams stock test cases,
|
3
|
+
mainly revised from ``andes.utils.paths``.
|
4
|
+
"""
|
5
|
+
import logging
|
6
|
+
import os
|
7
|
+
import pathlib
|
8
|
+
import tempfile
|
9
|
+
|
10
|
+
logger = logging.getLogger(__name__)
|
11
|
+
|
12
|
+
|
13
|
+
class DisplayablePath:
|
14
|
+
display_filename_prefix_middle = '├──'
|
15
|
+
display_filename_prefix_last = '└──'
|
16
|
+
display_parent_prefix_middle = ' '
|
17
|
+
display_parent_prefix_last = '│ '
|
18
|
+
|
19
|
+
def __init__(self, path, parent_path, is_last):
|
20
|
+
self.path = pathlib.Path(str(path))
|
21
|
+
self.parent = parent_path
|
22
|
+
self.is_last = is_last
|
23
|
+
if self.parent:
|
24
|
+
self.depth = self.parent.depth + 1
|
25
|
+
else:
|
26
|
+
self.depth = 0
|
27
|
+
|
28
|
+
@property
|
29
|
+
def displayname(self):
|
30
|
+
if self.path.is_dir():
|
31
|
+
return self.path.name + '/'
|
32
|
+
return self.path.name
|
33
|
+
|
34
|
+
@classmethod
|
35
|
+
def make_tree(cls, root, parent=None, is_last=False, criteria=None):
|
36
|
+
root = pathlib.Path(str(root))
|
37
|
+
criteria = criteria or cls._default_criteria
|
38
|
+
|
39
|
+
displayable_root = cls(root, parent, is_last)
|
40
|
+
yield displayable_root
|
41
|
+
|
42
|
+
children = sorted(list(path
|
43
|
+
for path in root.iterdir()
|
44
|
+
if criteria(path)),
|
45
|
+
key=lambda s: str(s).lower())
|
46
|
+
count = 1
|
47
|
+
for path in children:
|
48
|
+
is_last = count == len(children)
|
49
|
+
if path.is_dir():
|
50
|
+
yield from cls.make_tree(path,
|
51
|
+
parent=displayable_root,
|
52
|
+
is_last=is_last,
|
53
|
+
criteria=criteria)
|
54
|
+
else:
|
55
|
+
yield cls(path, displayable_root, is_last)
|
56
|
+
count += 1
|
57
|
+
|
58
|
+
@classmethod
|
59
|
+
def _default_criteria(cls, path):
|
60
|
+
return True
|
61
|
+
|
62
|
+
def displayable(self):
|
63
|
+
if self.parent is None:
|
64
|
+
return self.displayname
|
65
|
+
|
66
|
+
_filename_prefix = (self.display_filename_prefix_last
|
67
|
+
if self.is_last
|
68
|
+
else self.display_filename_prefix_middle)
|
69
|
+
|
70
|
+
parts = ['{!s} {!s}'.format(_filename_prefix,
|
71
|
+
self.displayname)]
|
72
|
+
|
73
|
+
parent = self.parent
|
74
|
+
while parent and parent.parent is not None:
|
75
|
+
parts.append(self.display_parent_prefix_middle
|
76
|
+
if parent.is_last
|
77
|
+
else self.display_parent_prefix_last)
|
78
|
+
parent = parent.parent
|
79
|
+
|
80
|
+
return ''.join(reversed(parts))
|
81
|
+
|
82
|
+
|
83
|
+
def ams_root():
|
84
|
+
"""
|
85
|
+
Return the root path to the ams source code.
|
86
|
+
"""
|
87
|
+
|
88
|
+
dir_name = os.path.dirname(os.path.abspath(__file__))
|
89
|
+
return os.path.normpath(os.path.join(dir_name, '..'))
|
90
|
+
|
91
|
+
|
92
|
+
def cases_root():
|
93
|
+
"""
|
94
|
+
Return the root path to the stock cases
|
95
|
+
"""
|
96
|
+
|
97
|
+
dir_name = os.path.dirname(os.path.abspath(__file__))
|
98
|
+
return os.path.normpath(os.path.join(dir_name, '..', 'cases'))
|
99
|
+
|
100
|
+
|
101
|
+
def tests_root():
|
102
|
+
"""Return the root path to the stock cases"""
|
103
|
+
dir_name = os.path.dirname(os.path.abspath(__file__))
|
104
|
+
return os.path.normpath(os.path.join(dir_name, '..', '..', 'tests'))
|
105
|
+
|
106
|
+
|
107
|
+
def get_case(rpath, check=True):
|
108
|
+
"""
|
109
|
+
Return the path to a stock case for a given path relative to ``ams/cases``.
|
110
|
+
|
111
|
+
To list all cases, use ``ams.list_cases()``.
|
112
|
+
|
113
|
+
Parameters
|
114
|
+
----------
|
115
|
+
check : bool
|
116
|
+
True to check if file exists
|
117
|
+
|
118
|
+
Examples
|
119
|
+
--------
|
120
|
+
To get the path to the case `kundur_full.xlsx` under folder `kundur`, do ::
|
121
|
+
|
122
|
+
ams.get_case('kundur/kundur_full.xlsx')
|
123
|
+
|
124
|
+
"""
|
125
|
+
case_path = os.path.join(cases_root(), rpath)
|
126
|
+
case_path = os.path.normpath(case_path)
|
127
|
+
|
128
|
+
if check is True and (not os.path.isfile(case_path)):
|
129
|
+
raise FileNotFoundError(f'"{rpath}" is not a valid relative path to a stock case.')
|
130
|
+
return case_path
|
131
|
+
|
132
|
+
|
133
|
+
def list_cases(rpath='.', no_print=False):
|
134
|
+
"""
|
135
|
+
List stock cases under a given folder relative to ``ams/cases``
|
136
|
+
"""
|
137
|
+
case_path = os.path.join(cases_root(), rpath)
|
138
|
+
case_path = os.path.normpath(case_path)
|
139
|
+
|
140
|
+
tree = DisplayablePath.make_tree(pathlib.Path(case_path))
|
141
|
+
out = []
|
142
|
+
for path in tree:
|
143
|
+
out.append(path.displayable())
|
144
|
+
|
145
|
+
out = '\n'.join(out)
|
146
|
+
if no_print is False:
|
147
|
+
print(out)
|
148
|
+
else:
|
149
|
+
return out
|
150
|
+
|
151
|
+
|
152
|
+
def get_config_path(file_name='ams.rc'):
|
153
|
+
"""
|
154
|
+
Return the path of the config file to be loaded.
|
155
|
+
|
156
|
+
Search Priority: 1. current directory; 2. home directory.
|
157
|
+
|
158
|
+
Parameters
|
159
|
+
----------
|
160
|
+
file_name : str, optional
|
161
|
+
Config file name with the default as ``ams.rc``.
|
162
|
+
|
163
|
+
Returns
|
164
|
+
-------
|
165
|
+
Config path in string if found; None otherwise.
|
166
|
+
"""
|
167
|
+
|
168
|
+
conf_path = None
|
169
|
+
home_dir = os.path.expanduser('~')
|
170
|
+
|
171
|
+
# test ./ams.conf
|
172
|
+
if os.path.isfile(file_name):
|
173
|
+
conf_path = file_name
|
174
|
+
# test ~/ams.conf
|
175
|
+
elif os.path.isfile(os.path.join(home_dir, '.ams', file_name)):
|
176
|
+
conf_path = os.path.join(home_dir, '.ams', file_name)
|
177
|
+
|
178
|
+
return conf_path
|
179
|
+
|
180
|
+
|
181
|
+
def get_pycode_path(pycode_path=None, mkdir=False):
|
182
|
+
"""
|
183
|
+
Get the path to the ``pycode`` folder.
|
184
|
+
"""
|
185
|
+
|
186
|
+
if pycode_path is None:
|
187
|
+
pycode_path = os.path.join(get_dot_andes_path(), 'pycode')
|
188
|
+
|
189
|
+
if mkdir is True:
|
190
|
+
os.makedirs(pycode_path, exist_ok=True)
|
191
|
+
|
192
|
+
return pycode_path
|
193
|
+
|
194
|
+
|
195
|
+
def get_pkl_path():
|
196
|
+
"""
|
197
|
+
Get the path to the picked/dilled function calls.
|
198
|
+
|
199
|
+
Returns
|
200
|
+
-------
|
201
|
+
str
|
202
|
+
Path to the calls.pkl file
|
203
|
+
|
204
|
+
"""
|
205
|
+
pkl_name = 'calls.pkl'
|
206
|
+
ams_path = get_dot_andes_path()
|
207
|
+
|
208
|
+
if not os.path.exists(ams_path):
|
209
|
+
os.makedirs(ams_path)
|
210
|
+
|
211
|
+
pkl_path = os.path.join(ams_path, pkl_name)
|
212
|
+
|
213
|
+
return pkl_path
|
214
|
+
|
215
|
+
|
216
|
+
def get_dot_andes_path():
|
217
|
+
"""
|
218
|
+
Return the path to ``$HOME/.ams``
|
219
|
+
"""
|
220
|
+
|
221
|
+
return os.path.join(str(pathlib.Path.home()), '.ams')
|
222
|
+
|
223
|
+
|
224
|
+
def get_log_dir():
|
225
|
+
"""
|
226
|
+
Get the directory for log file.
|
227
|
+
|
228
|
+
The default is ``<tempdir>/ams``, where ``<tempdir>`` is provided by ``tempfile.gettempdir()``.
|
229
|
+
|
230
|
+
Returns
|
231
|
+
-------
|
232
|
+
str
|
233
|
+
The path to the temporary logging directory
|
234
|
+
"""
|
235
|
+
tempdir = tempfile.gettempdir()
|
236
|
+
path = tempfile.mkdtemp(prefix='ams-', dir=tempdir)
|
237
|
+
return path
|
238
|
+
|
239
|
+
|
240
|
+
def confirm_overwrite(outfile, overwrite=None):
|
241
|
+
"""
|
242
|
+
Confirm overwriting a file.
|
243
|
+
"""
|
244
|
+
|
245
|
+
try:
|
246
|
+
if os.path.isfile(outfile):
|
247
|
+
if overwrite is None:
|
248
|
+
choice = input(f'File "{outfile}" already exist. Overwrite? [y/N]').lower()
|
249
|
+
if len(choice) == 0 or choice[0] != 'y':
|
250
|
+
logger.warning(f'File "{outfile}" not overwritten.')
|
251
|
+
return False
|
252
|
+
elif overwrite is False:
|
253
|
+
return False
|
254
|
+
except TypeError:
|
255
|
+
pass
|
256
|
+
|
257
|
+
return True
|
docs/Makefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
2
|
+
#
|
3
|
+
|
4
|
+
# You can set these variables from the command line, and also
|
5
|
+
# from the environment for the first two.
|
6
|
+
SPHINXOPTS = "-W" # This flag turns warnings into errors.
|
7
|
+
SPHINXBUILD = sphinx-build
|
8
|
+
SPHINXPROJ = PackagingScientificPython
|
9
|
+
SOURCEDIR = source
|
10
|
+
BUILDDIR = build
|
11
|
+
|
12
|
+
# Put it first so that "make" without argument is like "make help".
|
13
|
+
help:
|
14
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
15
|
+
|
16
|
+
.PHONY: help Makefile
|
17
|
+
|
18
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
19
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
20
|
+
%: Makefile
|
21
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
docs/make.bat
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
@ECHO OFF
|
2
|
+
|
3
|
+
pushd %~dp0
|
4
|
+
|
5
|
+
REM Command file for Sphinx documentation
|
6
|
+
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
8
|
+
set SPHINXBUILD=sphinx-build
|
9
|
+
)
|
10
|
+
set SOURCEDIR=source
|
11
|
+
set BUILDDIR=build
|
12
|
+
|
13
|
+
if "%1" == "" goto help
|
14
|
+
|
15
|
+
%SPHINXBUILD% >NUL 2>NUL
|
16
|
+
if errorlevel 9009 (
|
17
|
+
echo.
|
18
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
19
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
20
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
21
|
+
echo.may add the Sphinx directory to PATH.
|
22
|
+
echo.
|
23
|
+
echo.If you don't have Sphinx installed, grab it from
|
24
|
+
echo.https://www.sphinx-doc.org/
|
25
|
+
exit /b 1
|
26
|
+
)
|
27
|
+
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
29
|
+
goto end
|
30
|
+
|
31
|
+
:help
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
33
|
+
|
34
|
+
:end
|
35
|
+
popd
|
@@ -0,0 +1,35 @@
|
|
1
|
+
{{ fullname | escape | underline}}
|
2
|
+
|
3
|
+
.. currentmodule:: {{ module }}
|
4
|
+
|
5
|
+
.. autoclass:: {{ objname }}
|
6
|
+
|
7
|
+
{% block methods %}
|
8
|
+
.. automethod:: __init__
|
9
|
+
|
10
|
+
{% if methods %}
|
11
|
+
.. rubric:: {{ _('Methods') }}
|
12
|
+
|
13
|
+
.. autosummary::
|
14
|
+
:toctree: _generated/
|
15
|
+
|
16
|
+
{% for item in methods %}
|
17
|
+
{% if item != "__init__" %}
|
18
|
+
~{{ name }}.{{ item }}
|
19
|
+
{% endif %}
|
20
|
+
{%- endfor %}
|
21
|
+
{% endif %}
|
22
|
+
{% endblock %}
|
23
|
+
|
24
|
+
{% block attributes %}
|
25
|
+
{% if attributes %}
|
26
|
+
.. rubric:: {{ _('Attributes') }}
|
27
|
+
|
28
|
+
.. autosummary::
|
29
|
+
:toctree: _generated/
|
30
|
+
|
31
|
+
{% for item in attributes %}
|
32
|
+
~{{ name }}.{{ item }}
|
33
|
+
{%- endfor %}
|
34
|
+
{% endif %}
|
35
|
+
{% endblock %}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
{{ fullname | escape | underline}}
|
2
|
+
|
3
|
+
.. automodule:: {{ fullname }}
|
4
|
+
|
5
|
+
{% block attributes %}
|
6
|
+
{% if attributes %}
|
7
|
+
.. rubric:: Module Attributes
|
8
|
+
|
9
|
+
.. autosummary::
|
10
|
+
:toctree:
|
11
|
+
{% for item in attributes %}
|
12
|
+
{{ item }}
|
13
|
+
{%- endfor %}
|
14
|
+
{% endif %}
|
15
|
+
{% endblock %}
|
16
|
+
|
17
|
+
{% block functions %}
|
18
|
+
{% if functions %}
|
19
|
+
.. rubric:: {{ _('Functions') }}
|
20
|
+
|
21
|
+
.. autosummary::
|
22
|
+
:toctree:
|
23
|
+
{% for item in functions %}
|
24
|
+
{{ item }}
|
25
|
+
{%- endfor %}
|
26
|
+
{% endif %}
|
27
|
+
{% endblock %}
|
28
|
+
|
29
|
+
{% block classes %}
|
30
|
+
{% if classes %}
|
31
|
+
.. rubric:: {{ _('Classes') }}
|
32
|
+
|
33
|
+
.. autosummary::
|
34
|
+
:toctree:
|
35
|
+
{% for item in classes %}
|
36
|
+
{{ item }}
|
37
|
+
{%- endfor %}
|
38
|
+
{% endif %}
|
39
|
+
{% endblock %}
|
40
|
+
|
41
|
+
{% block exceptions %}
|
42
|
+
{% if exceptions %}
|
43
|
+
.. rubric:: {{ _('Exceptions') }}
|
44
|
+
|
45
|
+
.. autosummary::
|
46
|
+
:toctree:
|
47
|
+
{% for item in exceptions %}
|
48
|
+
{{ item }}
|
49
|
+
{%- endfor %}
|
50
|
+
{% endif %}
|
51
|
+
{% endblock %}
|
52
|
+
|
53
|
+
{% block modules %}
|
54
|
+
{% if modules %}
|
55
|
+
.. rubric:: Modules
|
56
|
+
|
57
|
+
|
58
|
+
.. autosummary::
|
59
|
+
:recursive:
|
60
|
+
|
61
|
+
{% for item in modules %}
|
62
|
+
{{ item }}
|
63
|
+
{%- endfor %}
|
64
|
+
{% endif %}
|
65
|
+
{% endblock %}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
{{ fullname | escape | underline}}
|
2
|
+
|
3
|
+
.. automodule:: {{ fullname }}
|
4
|
+
|
5
|
+
{% block attributes %}
|
6
|
+
{% if attributes %}
|
7
|
+
.. rubric:: Module Attributes
|
8
|
+
|
9
|
+
.. autosummary::
|
10
|
+
:toctree:
|
11
|
+
{% for item in attributes %}
|
12
|
+
{{ item }}
|
13
|
+
{%- endfor %}
|
14
|
+
{% endif %}
|
15
|
+
{% endblock %}
|
16
|
+
|
17
|
+
{% block functions %}
|
18
|
+
{% if functions %}
|
19
|
+
.. rubric:: {{ _('Functions') }}
|
20
|
+
|
21
|
+
.. autosummary::
|
22
|
+
:toctree:
|
23
|
+
{% for item in functions %}
|
24
|
+
{{ item }}
|
25
|
+
{%- endfor %}
|
26
|
+
{% endif %}
|
27
|
+
{% endblock %}
|
28
|
+
|
29
|
+
{% block classes %}
|
30
|
+
{% if classes %}
|
31
|
+
.. rubric:: {{ _('Classes') }}
|
32
|
+
|
33
|
+
.. autosummary::
|
34
|
+
:toctree:
|
35
|
+
{% for item in classes %}
|
36
|
+
{{ item }}
|
37
|
+
{%- endfor %}
|
38
|
+
{% endif %}
|
39
|
+
{% endblock %}
|
40
|
+
|
41
|
+
{% block exceptions %}
|
42
|
+
{% if exceptions %}
|
43
|
+
.. rubric:: {{ _('Exceptions') }}
|
44
|
+
|
45
|
+
.. autosummary::
|
46
|
+
:toctree:
|
47
|
+
{% for item in exceptions %}
|
48
|
+
{{ item }}
|
49
|
+
{%- endfor %}
|
50
|
+
{% endif %}
|
51
|
+
{% endblock %}
|
52
|
+
|
53
|
+
{% block modules %}
|
54
|
+
{% if modules %}
|
55
|
+
.. rubric:: Modules
|
56
|
+
|
57
|
+
|
58
|
+
.. autosummary::
|
59
|
+
:recursive:
|
60
|
+
:toctree:
|
61
|
+
|
62
|
+
{% for item in modules %}
|
63
|
+
{{ item }}
|
64
|
+
{%- endfor %}
|
65
|
+
{% endif %}
|
66
|
+
{% endblock %}
|
docs/source/api.rst
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
.. _api_reference:
|
2
|
+
|
3
|
+
=============
|
4
|
+
API reference
|
5
|
+
=============
|
6
|
+
|
7
|
+
|
8
|
+
System
|
9
|
+
======
|
10
|
+
|
11
|
+
.. autosummary::
|
12
|
+
:maxdepth:4
|
13
|
+
:recursive:
|
14
|
+
:toctree: _generated
|
15
|
+
:caption: System
|
16
|
+
:template: autosummary/module_toctree.rst
|
17
|
+
|
18
|
+
ams.system
|
19
|
+
|
20
|
+
|
21
|
+
Model
|
22
|
+
======
|
23
|
+
|
24
|
+
.. autosummary::
|
25
|
+
:maxdepth:4
|
26
|
+
:recursive:
|
27
|
+
:toctree: _generated
|
28
|
+
:caption: Model
|
29
|
+
:template: autosummary/module_toctree.rst
|
30
|
+
|
31
|
+
ams.core.model
|
32
|
+
ams.core.param
|
33
|
+
ams.core.service
|
34
|
+
|
35
|
+
|
36
|
+
Routines
|
37
|
+
========
|
38
|
+
|
39
|
+
.. autosummary::
|
40
|
+
:maxdepth:4
|
41
|
+
:recursive:
|
42
|
+
:toctree: _generated
|
43
|
+
:caption: Routines
|
44
|
+
:template: autosummary/module_toctree.rst
|
45
|
+
|
46
|
+
ams.routines.routine
|
47
|
+
ams.routines.dcopf
|
48
|
+
ams.routines.pflow
|
49
|
+
|
50
|
+
|
51
|
+
Optimization
|
52
|
+
=============
|
53
|
+
|
54
|
+
.. autosummary::
|
55
|
+
:maxdepth:4
|
56
|
+
:recursive:
|
57
|
+
:toctree: _generated
|
58
|
+
:caption: Optimization
|
59
|
+
:template: autosummary/module_toctree.rst
|
60
|
+
|
61
|
+
ams.opt
|
62
|
+
|
63
|
+
|
64
|
+
I/O
|
65
|
+
===
|
66
|
+
|
67
|
+
.. autosummary::
|
68
|
+
:maxdepth:4
|
69
|
+
:toctree: _generated
|
70
|
+
:recursive:
|
71
|
+
:caption: I/O
|
72
|
+
:template: autosummary/module_toctree.rst
|
73
|
+
|
74
|
+
ams.io
|
75
|
+
|
76
|
+
|
77
|
+
Interoperability
|
78
|
+
================
|
79
|
+
|
80
|
+
.. autosummary::
|
81
|
+
:maxdepth:4
|
82
|
+
:toctree: _generated
|
83
|
+
:recursive:
|
84
|
+
:caption: Interoperability
|
85
|
+
:template: autosummary/module_toctree.rst
|
86
|
+
|
87
|
+
ams.interface
|
88
|
+
|
89
|
+
|
90
|
+
Others
|
91
|
+
======
|
92
|
+
|
93
|
+
.. autosummary::
|
94
|
+
:maxdepth:4
|
95
|
+
:toctree: _generated
|
96
|
+
:recursive:
|
97
|
+
:caption: Others
|
98
|
+
:template: autosummary/module_toctree.rst
|
99
|
+
|
100
|
+
ams.cli
|
101
|
+
ams.main
|
102
|
+
ams.utils.paths
|