ltbams 1.0.13__py3-none-any.whl → 1.0.14__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/cli.py +2 -7
- ams/core/common.py +7 -3
- ams/core/documenter.py +2 -1
- ams/core/matprocessor.py +4 -4
- ams/core/model.py +14 -6
- ams/core/param.py +5 -3
- ams/core/symprocessor.py +8 -2
- ams/core/var.py +1 -1
- ams/extension/eva.py +11 -7
- ams/interface.py +7 -7
- ams/io/json.py +20 -16
- ams/io/matpower.py +6 -6
- ams/io/psse.py +2 -1
- ams/io/xlsx.py +21 -16
- ams/main.py +53 -45
- ams/models/distributed/esd1.py +4 -7
- ams/models/distributed/ev.py +10 -6
- ams/models/distributed/pvd1.py +4 -7
- ams/models/group.py +17 -18
- ams/models/renewable/regc.py +14 -22
- ams/models/timeslot.py +30 -0
- ams/models/zone.py +2 -4
- ams/opt/optzbase.py +4 -3
- ams/report.py +2 -7
- ams/routines/dcopf.py +7 -4
- ams/routines/dcopf2.py +14 -4
- ams/routines/dopf.py +2 -2
- ams/routines/ed.py +5 -5
- ams/routines/pflow.py +1 -1
- ams/routines/routine.py +8 -1
- ams/routines/rted.py +5 -5
- ams/routines/uc.py +2 -2
- ams/shared.py +69 -0
- ams/system.py +93 -18
- ams/utils/paths.py +6 -10
- docs/source/genroutineref.py +12 -0
- docs/source/release-notes.rst +6 -0
- {ltbams-1.0.13.dist-info → ltbams-1.0.14.dist-info}/METADATA +18 -22
- {ltbams-1.0.13.dist-info → ltbams-1.0.14.dist-info}/RECORD +43 -43
- {ltbams-1.0.13.dist-info → ltbams-1.0.14.dist-info}/WHEEL +0 -0
- {ltbams-1.0.13.dist-info → ltbams-1.0.14.dist-info}/entry_points.txt +0 -0
- {ltbams-1.0.13.dist-info → ltbams-1.0.14.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-08-
|
11
|
+
"date": "2025-08-31T23:37:40-0700",
|
12
12
|
"dirty": false,
|
13
13
|
"error": null,
|
14
|
-
"full-revisionid": "
|
15
|
-
"version": "1.0.
|
14
|
+
"full-revisionid": "595ed3a3be7f707c7c4aa79ac73bffa58919dc81",
|
15
|
+
"version": "1.0.14"
|
16
16
|
}
|
17
17
|
''' # END VERSION_JSON
|
18
18
|
|
ams/cli.py
CHANGED
@@ -23,18 +23,13 @@ command_aliases = {
|
|
23
23
|
|
24
24
|
def create_parser():
|
25
25
|
"""
|
26
|
-
Create a parser for the command-line interface
|
26
|
+
Create a parser for the command-line interface,
|
27
|
+
revised from `andes.cli.create_parser`.
|
27
28
|
|
28
29
|
Returns
|
29
30
|
-------
|
30
31
|
argparse.ArgumentParser
|
31
32
|
Parser with all AMS options
|
32
|
-
|
33
|
-
Notes
|
34
|
-
-----
|
35
|
-
Revised from the ANDES project (https://github.com/CURENT/andes).
|
36
|
-
Original author: Hantao Cui
|
37
|
-
License: GPL3
|
38
33
|
"""
|
39
34
|
|
40
35
|
parser = argparse.ArgumentParser()
|
ams/core/common.py
CHANGED
@@ -1,16 +1,20 @@
|
|
1
1
|
import logging
|
2
2
|
|
3
|
-
from andes.core.common import Config as
|
3
|
+
from andes.core.common import Config as adConfig
|
4
4
|
|
5
5
|
logger = logging.getLogger(__name__)
|
6
6
|
|
7
7
|
|
8
|
-
class Config(
|
8
|
+
class Config(adConfig):
|
9
9
|
"""
|
10
10
|
A class for storing configuration, can be used in system,
|
11
11
|
model, routine, and other modules.
|
12
12
|
|
13
|
-
Revised from `andes.core.common.Config
|
13
|
+
Revised from `andes.core.common.Config`, where update method
|
14
|
+
is modified to ensure values in the dictionary are set
|
15
|
+
in the configuration object.
|
16
|
+
|
17
|
+
.. versionadded:: 1.0.11
|
14
18
|
"""
|
15
19
|
|
16
20
|
def __init__(self, name, dct=None, **kwargs):
|
ams/core/documenter.py
CHANGED
ams/core/matprocessor.py
CHANGED
@@ -244,7 +244,7 @@ class MatProcessor:
|
|
244
244
|
The connectivity matrices `Cft`, `Cg`, `Cl`, and `Csh` ***have taken*** the
|
245
245
|
devices connectivity into account.
|
246
246
|
|
247
|
-
The MParams
|
247
|
+
The MParams row names and col names are assigned in `System.setup()`.
|
248
248
|
"""
|
249
249
|
|
250
250
|
def __init__(self, system):
|
@@ -627,7 +627,7 @@ class MatProcessor:
|
|
627
627
|
luid = [system.Line.idx2uid(line)]
|
628
628
|
self.PTDF.row_names = [line]
|
629
629
|
except ValueError:
|
630
|
-
raise ValueError(f"Line {line} not found.")
|
630
|
+
raise ValueError(f"Line {line} not found.") from None
|
631
631
|
elif isinstance(line, list):
|
632
632
|
luid = system.Line.idx2uid(line)
|
633
633
|
self.PTDF.row_names = line
|
@@ -725,7 +725,7 @@ class MatProcessor:
|
|
725
725
|
try:
|
726
726
|
luid = [system.Line.idx2uid(line)]
|
727
727
|
except ValueError:
|
728
|
-
raise ValueError(f"Line {line} not found.")
|
728
|
+
raise ValueError(f"Line {line} not found.") from None
|
729
729
|
elif isinstance(line, list):
|
730
730
|
luid = system.Line.idx2uid(line)
|
731
731
|
|
@@ -811,7 +811,7 @@ class MatProcessor:
|
|
811
811
|
try:
|
812
812
|
luid = [self.system.Line.idx2uid(line)]
|
813
813
|
except ValueError:
|
814
|
-
raise ValueError(f"Line {line} not found.")
|
814
|
+
raise ValueError(f"Line {line} not found.") from None
|
815
815
|
elif isinstance(line, list):
|
816
816
|
luid = self.system.Line.idx2uid(line)
|
817
817
|
|
ams/core/model.py
CHANGED
@@ -235,9 +235,11 @@ class Model:
|
|
235
235
|
|
236
236
|
Notes
|
237
237
|
-----
|
238
|
-
|
239
|
-
|
240
|
-
|
238
|
+
.. versionchanged:: 0.9.14
|
239
|
+
|
240
|
+
The ``attr`` argument was added to allow altering specific attributes.
|
241
|
+
This is useful when manipulating parameter values in the system base
|
242
|
+
and ensuring that changes are reflected in the dumped case file.
|
241
243
|
"""
|
242
244
|
|
243
245
|
instance = self.__dict__[src]
|
@@ -307,6 +309,11 @@ class Model:
|
|
307
309
|
Return the index of the model instance.
|
308
310
|
Equivalent to ``self.idx.v``, develoepd for consistency with group method
|
309
311
|
``get_idx``.
|
312
|
+
|
313
|
+
Notes
|
314
|
+
-----
|
315
|
+
.. deprecated:: 1.0.0
|
316
|
+
Use ``get_all_idxes`` instead.
|
310
317
|
"""
|
311
318
|
return self.idx.v
|
312
319
|
|
@@ -314,13 +321,14 @@ class Model:
|
|
314
321
|
"""
|
315
322
|
Return all the indexes of this model.
|
316
323
|
|
317
|
-
.. note::
|
318
|
-
New in version 1.0.0. Add to follow the group method ``get_all_idxes``.
|
319
|
-
|
320
324
|
Returns
|
321
325
|
-------
|
322
326
|
list
|
323
327
|
A list of indexes.
|
328
|
+
|
329
|
+
Notes
|
330
|
+
-----
|
331
|
+
.. versionadded:: 1.0.0
|
324
332
|
"""
|
325
333
|
return self.idx.v
|
326
334
|
|
ams/core/param.py
CHANGED
@@ -252,6 +252,9 @@ class RParam(Param):
|
|
252
252
|
Notes
|
253
253
|
-----
|
254
254
|
- The value will sort by the indexer if indexed.
|
255
|
+
|
256
|
+
.. deprecated:: 1.0.0
|
257
|
+
Use ``get_all_idxes`` instead.
|
255
258
|
"""
|
256
259
|
if self.indexer is None:
|
257
260
|
if self.is_group:
|
@@ -283,9 +286,6 @@ class RParam(Param):
|
|
283
286
|
"""
|
284
287
|
Get all the indexes of the parameter.
|
285
288
|
|
286
|
-
.. note::
|
287
|
-
New in version 1.0.0.
|
288
|
-
|
289
289
|
Returns
|
290
290
|
-------
|
291
291
|
idx : list
|
@@ -294,6 +294,8 @@ class RParam(Param):
|
|
294
294
|
Notes
|
295
295
|
-----
|
296
296
|
- The value will sort by the indexer if indexed.
|
297
|
+
|
298
|
+
.. versionadded:: 1.0.0
|
297
299
|
"""
|
298
300
|
if self.indexer is None:
|
299
301
|
if self.is_group:
|
ams/core/symprocessor.py
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
"""
|
2
|
-
Symbolic processor class for AMS routines
|
2
|
+
Symbolic processor class for AMS routines,
|
3
|
+
revised from `andes.core.symprocessor`.
|
3
4
|
|
4
|
-
|
5
|
+
Revised from the ANDES project:
|
6
|
+
https://github.com/CURENT/andes
|
7
|
+
|
8
|
+
Original author: Hantao Cui
|
9
|
+
|
10
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
5
11
|
"""
|
6
12
|
|
7
13
|
import logging
|
ams/core/var.py
CHANGED
ams/extension/eva.py
CHANGED
@@ -2,13 +2,6 @@
|
|
2
2
|
EV Aggregator module.
|
3
3
|
|
4
4
|
EVD is the generated datasets, and EVA is the aggregator model.
|
5
|
-
|
6
|
-
Reference:
|
7
|
-
[1] J. Wang et al., "Electric Vehicles Charging Time Constrained Deliverable Provision of Secondary
|
8
|
-
Frequency Regulation," in IEEE Transactions on Smart Grid, doi: 10.1109/TSG.2024.3356948.
|
9
|
-
[2] M. Wang, Y. Mu, Q. Shi, H. Jia and F. Li, "Electric Vehicle Aggregator Modeling and Control for
|
10
|
-
Frequency Regulation Considering Progressive State Recovery," in IEEE Transactions on Smart Grid,
|
11
|
-
vol. 11, no. 5, pp. 4176-4189, Sept. 2020, doi: 10.1109/TSG.2020.2981843.
|
12
5
|
"""
|
13
6
|
|
14
7
|
import logging
|
@@ -50,6 +43,17 @@ class EVD(ModelData, Model):
|
|
50
43
|
"""
|
51
44
|
In the EVD, each single EV is recorded as a device with its own parameters.
|
52
45
|
The parameters are generated from given statistical distributions.
|
46
|
+
|
47
|
+
References
|
48
|
+
----------
|
49
|
+
1. J. Wang et al., "Electric Vehicles Charging Time Constrained
|
50
|
+
Deliverable Provision of Secondary Frequency Regulation," in IEEE
|
51
|
+
Transactions on Smart Grid, vol. 15, no. 4, pp. 3892-3903, July
|
52
|
+
2024, doi: 10.1109/TSG.2024.3356948.
|
53
|
+
2. M. Wang, Y. Mu, Q. Shi, H. Jia and F. Li, "Electric Vehicle Aggregator
|
54
|
+
Modeling and Control for Frequency Regulation Considering Progressive
|
55
|
+
State Recovery," in IEEE Transactions on Smart Grid, vol. 11, no. 5,
|
56
|
+
pp. 4176-4189, Sept. 2020, doi: 10.1109/TSG.2020.2981843.
|
53
57
|
"""
|
54
58
|
|
55
59
|
def __init__(self, N=10000, Ns=20, Tagc=4, SOCf=0.2, r=0.5,
|
ams/interface.py
CHANGED
@@ -177,9 +177,9 @@ def to_andes(system, addfile=None,
|
|
177
177
|
|
178
178
|
Notes
|
179
179
|
-----
|
180
|
-
|
181
|
-
|
182
|
-
|
180
|
+
- Power flow models in the addfile will be skipped and only dynamic models will be used.
|
181
|
+
- The addfile format is guessed based on the file extension. Currently only ``xlsx`` is supported.
|
182
|
+
- Index in the addfile is automatically adjusted when necessary.
|
183
183
|
"""
|
184
184
|
t0, _ = elapsed()
|
185
185
|
|
@@ -446,9 +446,9 @@ class Dynamic:
|
|
446
446
|
|
447
447
|
Notes
|
448
448
|
-----
|
449
|
-
|
450
|
-
|
451
|
-
|
449
|
+
- Using the file conversion ``to_andes()`` will automatically
|
450
|
+
link the AMS system to the converted ANDES system in the
|
451
|
+
attribute ``dyn``.
|
452
452
|
|
453
453
|
Examples
|
454
454
|
--------
|
@@ -503,7 +503,7 @@ class Dynamic:
|
|
503
503
|
|
504
504
|
Notes
|
505
505
|
-----
|
506
|
-
|
506
|
+
- AGC power reference ``paux`` is not included in this function.
|
507
507
|
"""
|
508
508
|
# 1) TurbineGov
|
509
509
|
syg_idx = sp.dyn.link['syg_idx'].dropna().tolist() # SynGen idx
|
ams/io/json.py
CHANGED
@@ -11,7 +11,9 @@ from collections import OrderedDict
|
|
11
11
|
from andes.io.json import (testlines, read) # NOQA
|
12
12
|
from andes.utils.paths import confirm_overwrite
|
13
13
|
|
14
|
-
from ams.shared import
|
14
|
+
from ams.shared import pd
|
15
|
+
from ams.shared import summary_row, summary_name, model2df
|
16
|
+
|
15
17
|
|
16
18
|
logger = logging.getLogger(__name__)
|
17
19
|
|
@@ -24,7 +26,8 @@ def write(system, outfile, skip_empty=True, overwrite=None,
|
|
24
26
|
If to_andes is True, only write models that are in ANDES,
|
25
27
|
but the outfile might not be able to be read back into AMS.
|
26
28
|
|
27
|
-
|
29
|
+
Revised from `andes.io.json.write`, where non-andes models
|
30
|
+
are skipped if `to_andes` is True.
|
28
31
|
|
29
32
|
Parameters
|
30
33
|
----------
|
@@ -63,20 +66,21 @@ def _dump_system(system, skip_empty, orient='records', to_andes=False):
|
|
63
66
|
them all in an OrderedDict.
|
64
67
|
"""
|
65
68
|
out = OrderedDict()
|
69
|
+
summary_found = False
|
66
70
|
for name, instance in system.models.items():
|
67
|
-
|
71
|
+
df = model2df(instance, skip_empty, to_andes=to_andes)
|
72
|
+
if df is None:
|
68
73
|
continue
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
out[name] = df.to_dict(orient=orient)
|
74
|
+
|
75
|
+
if name == summary_name:
|
76
|
+
df = pd.concat([pd.DataFrame([summary_row]), df], ignore_index=True)
|
77
|
+
df.index.name = "uid"
|
78
|
+
summary_found = True
|
79
|
+
out[name] = df.to_dict(orient=orient)
|
80
|
+
|
81
|
+
if not summary_found:
|
82
|
+
df = pd.DataFrame([summary_row])
|
83
|
+
df.index.name = "uid"
|
84
|
+
out[summary_name] = df.to_dict(orient=orient)
|
85
|
+
|
82
86
|
return json.dumps(out, indent=2)
|
ams/io/matpower.py
CHANGED
@@ -36,10 +36,11 @@ def read(system, file):
|
|
36
36
|
|
37
37
|
def m2mpc(infile: str) -> dict:
|
38
38
|
"""
|
39
|
-
Parse a MATPOWER file and return a dictionary containing the parsed data
|
39
|
+
Parse a MATPOWER file and return a dictionary containing the parsed data,
|
40
|
+
revised from `andes.io.matpower.m2mpc`.
|
40
41
|
|
41
42
|
This function processes MATPOWER case files and extracts relevant fields
|
42
|
-
into a structured dictionary.
|
43
|
+
into a structured dictionary.
|
43
44
|
|
44
45
|
Supported fields include:
|
45
46
|
- `baseMVA`: The system base power in MVA.
|
@@ -181,9 +182,8 @@ def m2mpc(infile: str) -> dict:
|
|
181
182
|
|
182
183
|
def mpc2system(mpc: dict, system) -> bool:
|
183
184
|
"""
|
184
|
-
Load an mpc dict into an empty AMS system
|
185
|
-
|
186
|
-
Revised from ``andes.io.matpower.mpc2system``.
|
185
|
+
Load an mpc dict into an empty AMS system, revised from
|
186
|
+
`andes.io.matpower.mpc2system`.
|
187
187
|
|
188
188
|
Note that `mbase` in mpc is converted to `Sn`, but it is not actually used in
|
189
189
|
MATPOWER nor AMS.
|
@@ -453,7 +453,7 @@ def system2mpc(system) -> dict:
|
|
453
453
|
"""
|
454
454
|
Convert a **setup** AMS system to a MATPOWER mpc dictionary.
|
455
455
|
|
456
|
-
|
456
|
+
Revised from `andes.io.matpower.system2mpc`.
|
457
457
|
|
458
458
|
Parameters
|
459
459
|
----------
|
ams/io/psse.py
CHANGED
@@ -16,7 +16,8 @@ def read(system, file):
|
|
16
16
|
"""
|
17
17
|
Read PSS/E RAW file v32/v33 formats.
|
18
18
|
|
19
|
-
Revised from
|
19
|
+
Revised from `andes.io.psse.read`, where model ``Zone`` is completed
|
20
|
+
when necessary.
|
20
21
|
"""
|
21
22
|
ret = ad_read(system, file)
|
22
23
|
# Extract zone data
|
ams/io/xlsx.py
CHANGED
@@ -7,7 +7,8 @@ import logging
|
|
7
7
|
|
8
8
|
from andes.io.xlsx import (read, testlines, confirm_overwrite, _add_book) # NOQA
|
9
9
|
|
10
|
-
from ams.shared import pd
|
10
|
+
from ams.shared import pd
|
11
|
+
from ams.shared import summary_row, summary_name, model2df
|
11
12
|
|
12
13
|
|
13
14
|
logger = logging.getLogger(__name__)
|
@@ -20,7 +21,8 @@ def write(system, outfile,
|
|
20
21
|
"""
|
21
22
|
Write loaded AMS system data into an xlsx file
|
22
23
|
|
23
|
-
Revised
|
24
|
+
Revised from `andes.io.xlsx.write`, where non-ANDES models
|
25
|
+
are skipped if `to_andes` is True.
|
24
26
|
|
25
27
|
Parameters
|
26
28
|
----------
|
@@ -59,22 +61,25 @@ def _write_system(system, writer, skip_empty, to_andes=False):
|
|
59
61
|
"""
|
60
62
|
Write the system to pandas ExcelWriter
|
61
63
|
|
62
|
-
|
64
|
+
Revised from `andes.io.xlsx._write_system`, where non-ANDES models
|
65
|
+
are skipped if `to_andes` is True.
|
63
66
|
"""
|
67
|
+
summary_found = False
|
64
68
|
for name, instance in system.models.items():
|
65
|
-
|
69
|
+
df = model2df(instance, skip_empty, to_andes=to_andes)
|
70
|
+
if df is None:
|
66
71
|
continue
|
67
|
-
|
68
|
-
if
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
ams_params = list(instance.params.keys())
|
74
|
-
andes_params = list(empty_adsys.models[name].params.keys())
|
75
|
-
skip_params = list(set(ams_params) - set(andes_params))
|
76
|
-
df = instance.cache.df_in.drop(skip_params, axis=1, errors='ignore')
|
77
|
-
else:
|
78
|
-
df = instance.cache.df_in
|
72
|
+
|
73
|
+
if name == summary_name:
|
74
|
+
df = pd.concat([pd.DataFrame([summary_row]), df], ignore_index=True)
|
75
|
+
df.index.name = "uid"
|
76
|
+
summary_found = True
|
77
|
+
|
79
78
|
df.to_excel(writer, sheet_name=name, freeze_panes=(1, 0))
|
79
|
+
|
80
|
+
if not summary_found:
|
81
|
+
df = pd.DataFrame([summary_row])
|
82
|
+
df.index.name = "uid"
|
83
|
+
df.to_excel(writer, sheet_name=summary_name, freeze_panes=(1, 0))
|
84
|
+
|
80
85
|
return writer
|
ams/main.py
CHANGED
@@ -48,7 +48,7 @@ def config_logger(stream_level=logging.INFO, *,
|
|
48
48
|
stream : bool, optional
|
49
49
|
Create a `StreamHandler` for `stdout` if ``True``.
|
50
50
|
If ``False``, the handler will not be created.
|
51
|
-
file : bool,
|
51
|
+
file : bool, optional
|
52
52
|
True if logging to ``log_file``.
|
53
53
|
log_file : str, optional
|
54
54
|
Logg file name for `FileHandler`, ``'ams.log'`` by default.
|
@@ -67,9 +67,12 @@ def config_logger(stream_level=logging.INFO, *,
|
|
67
67
|
|
68
68
|
Notes
|
69
69
|
-----
|
70
|
-
Copied from the ANDES project
|
70
|
+
Copied from the ANDES project:
|
71
|
+
https://github.com/CURENT/andes
|
72
|
+
|
71
73
|
Original author: Hantao Cui
|
72
|
-
|
74
|
+
|
75
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
73
76
|
"""
|
74
77
|
lg = logging.getLogger('ams')
|
75
78
|
lg.setLevel(logging.DEBUG)
|
@@ -118,6 +121,7 @@ def load(case, setup=True,
|
|
118
121
|
"""
|
119
122
|
Load a case and set up a system without running routine.
|
120
123
|
Return a system.
|
124
|
+
Revised from `andes.main.load`.
|
121
125
|
|
122
126
|
Takes other kwargs recognizable by ``System``,
|
123
127
|
such as ``addfile``, ``input_path``, and ``no_putput``.
|
@@ -137,12 +141,6 @@ def load(case, setup=True,
|
|
137
141
|
If one need to add devices in addition to these from the case
|
138
142
|
file, do ``setup=False`` and call ``System.add()`` to add devices.
|
139
143
|
When done, manually invoke ``setup()`` to set up the system.
|
140
|
-
|
141
|
-
Notes
|
142
|
-
-----
|
143
|
-
Revised from the ANDES project (https://github.com/CURENT/andes).
|
144
|
-
Original author: Hantao Cui
|
145
|
-
License: GPL3
|
146
144
|
"""
|
147
145
|
if use_input_path:
|
148
146
|
input_path = kwargs.get('input_path', '')
|
@@ -172,6 +170,8 @@ def run_case(case, *, routine='pflow', profile=False,
|
|
172
170
|
Run single simulation case for the given full path.
|
173
171
|
Use ``run`` instead of ``run_case`` whenever possible.
|
174
172
|
|
173
|
+
Revised from `andes.main.run_case`.
|
174
|
+
|
175
175
|
Argument ``input_path`` will not be prepended to ``case``.
|
176
176
|
|
177
177
|
Arguments recognizable by ``load`` can be passed to ``run_case``.
|
@@ -192,12 +192,6 @@ def run_case(case, *, routine='pflow', profile=False,
|
|
192
192
|
add_book : str, optional
|
193
193
|
Name of the device to be added to an excel case
|
194
194
|
as a new sheet.
|
195
|
-
|
196
|
-
Notes
|
197
|
-
-----
|
198
|
-
Revised from the ANDES project (https://github.com/CURENT/andes).
|
199
|
-
Original author: Hantao Cui
|
200
|
-
License: GPL3
|
201
195
|
"""
|
202
196
|
|
203
197
|
pr = cProfile.Profile()
|
@@ -270,9 +264,12 @@ def _run_mp_proc(cases, ncpu=NCPUS_PHYSICAL, **kwargs):
|
|
270
264
|
|
271
265
|
Notes
|
272
266
|
-----
|
273
|
-
Copied from the ANDES project
|
267
|
+
Copied from the ANDES project:
|
268
|
+
https://github.com/CURENT/andes
|
269
|
+
|
274
270
|
Original author: Hantao Cui
|
275
|
-
|
271
|
+
|
272
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
276
273
|
"""
|
277
274
|
|
278
275
|
# start processes
|
@@ -310,9 +307,12 @@ def _run_mp_pool(cases, ncpu=NCPUS_PHYSICAL, verbose=logging.INFO, **kwargs):
|
|
310
307
|
|
311
308
|
Notes
|
312
309
|
-----
|
313
|
-
Copied from the ANDES project
|
310
|
+
Copied from the ANDES project:
|
311
|
+
https://github.com/CURENT/andes
|
312
|
+
|
314
313
|
Original author: Hantao Cui
|
315
|
-
|
314
|
+
|
315
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
316
316
|
"""
|
317
317
|
|
318
318
|
pool = Pool(ncpu)
|
@@ -369,9 +369,12 @@ def run(filename, input_path='', verbose=20, mp_verbose=30,
|
|
369
369
|
|
370
370
|
Notes
|
371
371
|
-----
|
372
|
-
Copied from the ANDES project
|
372
|
+
Copied from the ANDES project:
|
373
|
+
https://github.com/CURENT/andes
|
374
|
+
|
373
375
|
Original author: Hantao Cui
|
374
|
-
|
376
|
+
|
377
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
375
378
|
"""
|
376
379
|
|
377
380
|
if is_interactive() and len(logger.handlers) == 0:
|
@@ -497,9 +500,12 @@ def misc(edit_config='', save_config='', show_license=False, clean=True, recursi
|
|
497
500
|
|
498
501
|
Notes
|
499
502
|
-----
|
500
|
-
Copied from the ANDES project
|
503
|
+
Copied from the ANDES project:
|
504
|
+
https://github.com/CURENT/andes
|
505
|
+
|
501
506
|
Original author: Hantao Cui
|
502
|
-
|
507
|
+
|
508
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
503
509
|
"""
|
504
510
|
|
505
511
|
if edit_conf(edit_config):
|
@@ -527,13 +533,8 @@ def misc(edit_config='', save_config='', show_license=False, clean=True, recursi
|
|
527
533
|
|
528
534
|
def doc(attribute=None, list_supported=False, config=False, **kwargs):
|
529
535
|
"""
|
530
|
-
Quick documentation from command-line
|
531
|
-
|
532
|
-
Notes
|
533
|
-
-----
|
534
|
-
Revised from the ANDES project (https://github.com/CURENT/andes).
|
535
|
-
Original author: Hantao Cui
|
536
|
-
License: GPL3
|
536
|
+
Quick documentation from command-line,
|
537
|
+
revised from `andes.main.doc`.
|
537
538
|
"""
|
538
539
|
system = System()
|
539
540
|
if attribute is not None:
|
@@ -558,13 +559,8 @@ def demo(**kwargs):
|
|
558
559
|
|
559
560
|
def versioninfo():
|
560
561
|
"""
|
561
|
-
Print version info for AMS and dependencies
|
562
|
-
|
563
|
-
Notes
|
564
|
-
-----
|
565
|
-
Revised from the ANDES project (https://github.com/CURENT/andes).
|
566
|
-
Original author: Hantao Cui
|
567
|
-
License: GPL3
|
562
|
+
Print version info for AMS and dependencies,
|
563
|
+
revised from `andes.main.versioninfo`.
|
568
564
|
"""
|
569
565
|
|
570
566
|
import numpy as np
|
@@ -630,9 +626,12 @@ def edit_conf(edit_config: Optional[Union[str, bool]] = ''):
|
|
630
626
|
|
631
627
|
Notes
|
632
628
|
-----
|
633
|
-
Copied from the ANDES project
|
629
|
+
Copied from the ANDES project:
|
630
|
+
https://github.com/CURENT/andes
|
631
|
+
|
634
632
|
Original author: Hantao Cui
|
635
|
-
|
633
|
+
|
634
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
636
635
|
"""
|
637
636
|
ret = False
|
638
637
|
|
@@ -689,9 +688,12 @@ def save_conf(config_path=None, overwrite=None, **kwargs):
|
|
689
688
|
|
690
689
|
Notes
|
691
690
|
-----
|
692
|
-
Copied from the ANDES project
|
691
|
+
Copied from the ANDES project:
|
692
|
+
https://github.com/CURENT/andes
|
693
|
+
|
693
694
|
Original author: Hantao Cui
|
694
|
-
|
695
|
+
|
696
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
695
697
|
"""
|
696
698
|
ret = False
|
697
699
|
|
@@ -729,9 +731,12 @@ def remove_output(recursive=False):
|
|
729
731
|
|
730
732
|
Notes
|
731
733
|
-----
|
732
|
-
Copied from the ANDES project
|
734
|
+
Copied from the ANDES project:
|
735
|
+
https://github.com/CURENT/andes
|
736
|
+
|
733
737
|
Original author: Hantao Cui
|
734
|
-
|
738
|
+
|
739
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
735
740
|
"""
|
736
741
|
found = False
|
737
742
|
cwd = os.getcwd()
|
@@ -764,9 +769,12 @@ def selftest(quick=False, extra=False, **kwargs):
|
|
764
769
|
|
765
770
|
Notes
|
766
771
|
-----
|
767
|
-
Copied from the ANDES project
|
772
|
+
Copied from the ANDES project:
|
773
|
+
https://github.com/CURENT/andes
|
774
|
+
|
768
775
|
Original author: Hantao Cui
|
769
|
-
|
776
|
+
|
777
|
+
License: GNU General Public License v3.0 (GPL-3.0)
|
770
778
|
"""
|
771
779
|
|
772
780
|
# map verbosity level from logging to unittest
|
ams/models/distributed/esd1.py
CHANGED
@@ -56,13 +56,10 @@ class ESD1(ESD1Data, Model):
|
|
56
56
|
``vt3``, ``vrflag``, ``ft0``, ``ft1``, ``ft2``, ``ft3``, ``frflag``,
|
57
57
|
``tip``, ``tiq``, ``recflag``.
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
Available:
|
64
|
-
|
65
|
-
https://docs.andes.app/en/latest/groupdoc/DG.html#esd1
|
59
|
+
References
|
60
|
+
----------
|
61
|
+
1. ANDES Documentation, ESD1,
|
62
|
+
https://andes.readthedocs.io/en/stable/groupdoc/DG.html#esd1
|
66
63
|
"""
|
67
64
|
|
68
65
|
def __init__(self, system, config):
|