power-grid-model 1.11.23__py3-none-win_amd64.whl → 1.12.70__py3-none-win_amd64.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.
- power_grid_model/__init__.py +54 -52
- power_grid_model/_core/__init__.py +3 -3
- power_grid_model/_core/buffer_handling.py +493 -478
- power_grid_model/_core/data_handling.py +195 -141
- power_grid_model/_core/data_types.py +143 -132
- power_grid_model/_core/dataset_definitions.py +109 -108
- power_grid_model/_core/enum.py +226 -226
- power_grid_model/_core/error_handling.py +206 -205
- power_grid_model/_core/errors.py +130 -126
- power_grid_model/_core/index_integer.py +17 -17
- power_grid_model/_core/options.py +71 -70
- power_grid_model/_core/power_grid_core.py +563 -581
- power_grid_model/_core/power_grid_dataset.py +535 -534
- power_grid_model/_core/power_grid_meta.py +257 -243
- power_grid_model/_core/power_grid_model.py +969 -687
- power_grid_model/_core/power_grid_model_c/__init__.py +3 -0
- power_grid_model/_core/power_grid_model_c/bin/power_grid_model_c.dll +0 -0
- power_grid_model/_core/power_grid_model_c/get_pgm_dll_path.py +63 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/basics.h +255 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/buffer.h +108 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/dataset.h +316 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h +1052 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/handle.h +99 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/meta_data.h +189 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/model.h +125 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/options.h +142 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/serialization.h +118 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c.h +36 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/basics.hpp +65 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/buffer.hpp +61 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/dataset.hpp +220 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/handle.hpp +108 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/meta_data.hpp +84 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/model.hpp +63 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/options.hpp +52 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/serialization.hpp +124 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/utils.hpp +81 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp.hpp +19 -0
- power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelConfig.cmake +37 -0
- power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelConfigVersion.cmake +65 -0
- power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelTargets-release.cmake +19 -0
- power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelTargets.cmake +144 -0
- power_grid_model/_core/power_grid_model_c/lib/power_grid_model_c.lib +0 -0
- power_grid_model/_core/power_grid_model_c/share/LICENSE +292 -0
- power_grid_model/_core/power_grid_model_c/share/README.md +15 -0
- power_grid_model/_core/serialization.py +317 -317
- power_grid_model/_core/typing.py +20 -20
- power_grid_model/_core/utils.py +798 -789
- power_grid_model/data_types.py +321 -307
- power_grid_model/enum.py +27 -27
- power_grid_model/errors.py +37 -37
- power_grid_model/typing.py +43 -43
- power_grid_model/utils.py +473 -465
- power_grid_model/validation/__init__.py +25 -25
- power_grid_model/validation/_rules.py +1171 -1175
- power_grid_model/validation/_validation.py +1172 -1158
- power_grid_model/validation/assertions.py +93 -93
- power_grid_model/validation/errors.py +602 -588
- power_grid_model/validation/utils.py +313 -321
- {power_grid_model-1.11.23.dist-info → power_grid_model-1.12.70.dist-info}/METADATA +178 -180
- power_grid_model-1.12.70.dist-info/RECORD +65 -0
- {power_grid_model-1.11.23.dist-info → power_grid_model-1.12.70.dist-info}/WHEEL +1 -1
- power_grid_model-1.12.70.dist-info/entry_points.txt +3 -0
- power_grid_model/_core/_power_grid_core.dll +0 -0
- power_grid_model-1.11.23.dist-info/RECORD +0 -36
- power_grid_model-1.11.23.dist-info/top_level.txt +0 -1
- {power_grid_model-1.11.23.dist-info → power_grid_model-1.12.70.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,108 +1,109 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
|
|
5
|
-
"""Data types for power grid model dataset and component types."""
|
|
6
|
-
|
|
7
|
-
# This file is automatically generated. DO NOT modify it manually!
|
|
8
|
-
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- DatasetType.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- ComponentType.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
|
|
5
|
+
"""Data types for power grid model dataset and component types."""
|
|
6
|
+
|
|
7
|
+
# This file is automatically generated. DO NOT modify it manually!
|
|
8
|
+
|
|
9
|
+
from collections.abc import Mapping
|
|
10
|
+
from enum import Enum, EnumMeta
|
|
11
|
+
from typing import Any, TypeAlias, TypeVar
|
|
12
|
+
|
|
13
|
+
# fmt: off
|
|
14
|
+
|
|
15
|
+
class _MetaEnum(EnumMeta):
|
|
16
|
+
def __contains__(cls, member):
|
|
17
|
+
"""
|
|
18
|
+
Check if member is part of the Enum.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
member: Member to check.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
bool: True if the member is part of the Enum, False otherwise.
|
|
25
|
+
"""
|
|
26
|
+
return member in cls.__members__
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class DatasetType(str, Enum, metaclass=_MetaEnum):
|
|
30
|
+
"""
|
|
31
|
+
A DatasetType is the type of a :class:`Dataset` in power grid model.
|
|
32
|
+
|
|
33
|
+
- Examples:
|
|
34
|
+
|
|
35
|
+
- DatasetType.input = "input"
|
|
36
|
+
- DatasetType.update = "update"
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
input = "input"
|
|
40
|
+
sym_output = "sym_output"
|
|
41
|
+
asym_output = "asym_output"
|
|
42
|
+
update = "update"
|
|
43
|
+
sc_output = "sc_output"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class ComponentType(str, Enum, metaclass=_MetaEnum):
|
|
47
|
+
"""
|
|
48
|
+
A ComponentType is the type of a grid component.
|
|
49
|
+
|
|
50
|
+
- Examples:
|
|
51
|
+
|
|
52
|
+
- ComponentType.node = "node"
|
|
53
|
+
- ComponentType.line = "line"
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
node = "node"
|
|
57
|
+
line = "line"
|
|
58
|
+
asym_line = "asym_line"
|
|
59
|
+
link = "link"
|
|
60
|
+
generic_branch = "generic_branch"
|
|
61
|
+
transformer = "transformer"
|
|
62
|
+
transformer_tap_regulator = "transformer_tap_regulator"
|
|
63
|
+
three_winding_transformer = "three_winding_transformer"
|
|
64
|
+
sym_load = "sym_load"
|
|
65
|
+
sym_gen = "sym_gen"
|
|
66
|
+
asym_load = "asym_load"
|
|
67
|
+
asym_gen = "asym_gen"
|
|
68
|
+
shunt = "shunt"
|
|
69
|
+
source = "source"
|
|
70
|
+
sym_voltage_sensor = "sym_voltage_sensor"
|
|
71
|
+
asym_voltage_sensor = "asym_voltage_sensor"
|
|
72
|
+
sym_power_sensor = "sym_power_sensor"
|
|
73
|
+
asym_power_sensor = "asym_power_sensor"
|
|
74
|
+
sym_current_sensor = "sym_current_sensor"
|
|
75
|
+
asym_current_sensor = "asym_current_sensor"
|
|
76
|
+
fault = "fault"
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
DatasetTypeLike: TypeAlias = DatasetType | str
|
|
80
|
+
DatasetTypeVar = TypeVar("DatasetTypeVar", bound=DatasetTypeLike) # helper used for type deduction
|
|
81
|
+
|
|
82
|
+
ComponentTypeLike: TypeAlias = ComponentType | str
|
|
83
|
+
ComponentTypeVar = TypeVar("ComponentTypeVar", bound=ComponentTypeLike) # helper used for type deduction
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _str_to_datatype(data_type: DatasetTypeLike) -> DatasetType:
|
|
87
|
+
"""Helper function to transform data_type str to DatasetType."""
|
|
88
|
+
if isinstance(data_type, DatasetType):
|
|
89
|
+
return data_type
|
|
90
|
+
return DatasetType[data_type]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _map_to_datatypes(data: Mapping[DatasetTypeVar, Any]) -> dict[DatasetType, Any]:
|
|
94
|
+
"""Helper function to map datatype str keys to DatasetType."""
|
|
95
|
+
return {_str_to_datatype(key): value for key, value in data.items()}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _str_to_component_type(component: ComponentTypeLike) -> ComponentType:
|
|
99
|
+
"""Helper function to transform component str to ComponentType."""
|
|
100
|
+
if isinstance(component, ComponentType):
|
|
101
|
+
return component
|
|
102
|
+
return ComponentType[component]
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _map_to_component_types(data: Mapping[ComponentTypeVar, Any]) -> dict[ComponentType, Any]:
|
|
106
|
+
"""Helper function to map componenttype str keys to ComponentType."""
|
|
107
|
+
return {_str_to_component_type(key): value for key, value in data.items()}
|
|
108
|
+
|
|
109
|
+
# fmt: on
|
power_grid_model/_core/enum.py
CHANGED
|
@@ -1,226 +1,226 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
|
|
5
|
-
"""
|
|
6
|
-
Common enumerations for library-internal use.
|
|
7
|
-
|
|
8
|
-
Note: these enumeration match the C++ arithmetic core, so don't change the values unless you change them in C++ as well
|
|
9
|
-
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
from enum import IntEnum
|
|
13
|
-
|
|
14
|
-
# Value names are defined in lower case instead of upper case
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class CalculationType(IntEnum):
|
|
18
|
-
"""Calculation Types"""
|
|
19
|
-
|
|
20
|
-
power_flow = 0
|
|
21
|
-
state_estimation = 1
|
|
22
|
-
short_circuit = 2
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class CalculationMethod(IntEnum):
|
|
26
|
-
"""Calculation Methods"""
|
|
27
|
-
|
|
28
|
-
linear = 0
|
|
29
|
-
newton_raphson = 1
|
|
30
|
-
iterative_linear = 2
|
|
31
|
-
iterative_current = 3
|
|
32
|
-
linear_current = 4
|
|
33
|
-
iec60909 = 5
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class TapChangingStrategy(IntEnum):
|
|
37
|
-
"""Tap Changing Strategies"""
|
|
38
|
-
|
|
39
|
-
disabled = 0
|
|
40
|
-
"""
|
|
41
|
-
Disable automatic tap adjustment
|
|
42
|
-
"""
|
|
43
|
-
any_valid_tap = 1
|
|
44
|
-
"""
|
|
45
|
-
Adjust tap position automatically; optimize for any value in the voltage band
|
|
46
|
-
"""
|
|
47
|
-
min_voltage_tap = 2
|
|
48
|
-
"""
|
|
49
|
-
Adjust tap position automatically; optimize for the lower end of the voltage band
|
|
50
|
-
"""
|
|
51
|
-
max_voltage_tap = 3
|
|
52
|
-
"""
|
|
53
|
-
Adjust tap position automatically; optimize for the higher end of the voltage band
|
|
54
|
-
"""
|
|
55
|
-
fast_any_tap = 4
|
|
56
|
-
"""
|
|
57
|
-
Adjust tap position automatically; optimize for any value in the voltage band; binary search
|
|
58
|
-
"""
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
class AngleMeasurementType(IntEnum):
|
|
62
|
-
"""The type of the angle measurement for current sensors."""
|
|
63
|
-
|
|
64
|
-
local_angle = 0
|
|
65
|
-
"""
|
|
66
|
-
The angle is relative to the local voltage angle
|
|
67
|
-
"""
|
|
68
|
-
global_angle = 1
|
|
69
|
-
"""
|
|
70
|
-
The angle is relative to the global voltage angle.
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class ShortCircuitVoltageScaling(IntEnum):
|
|
75
|
-
"""Voltage scaling for short circuit calculations"""
|
|
76
|
-
|
|
77
|
-
minimum = 0
|
|
78
|
-
maximum = 1
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class _ExperimentalFeatures(IntEnum):
|
|
82
|
-
"""Experimental features"""
|
|
83
|
-
|
|
84
|
-
disabled = 0
|
|
85
|
-
enabled = 1
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class ComponentAttributeFilterOptions(IntEnum):
|
|
89
|
-
"""Filter option component or attribute"""
|
|
90
|
-
|
|
91
|
-
everything = 0
|
|
92
|
-
"""Filter all components/attributes"""
|
|
93
|
-
relevant = 1
|
|
94
|
-
"""Filter only non-empty components/attributes that contain non-NaN values"""
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class LoadGenType(IntEnum):
|
|
98
|
-
"""Load and Generator Types"""
|
|
99
|
-
|
|
100
|
-
const_power = 0
|
|
101
|
-
const_impedance = 1
|
|
102
|
-
const_current = 2
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class WindingType(IntEnum):
|
|
106
|
-
"""Transformer Winding Types"""
|
|
107
|
-
|
|
108
|
-
wye = 0
|
|
109
|
-
wye_n = 1
|
|
110
|
-
delta = 2
|
|
111
|
-
zigzag = 3
|
|
112
|
-
zigzag_n = 4
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
class BranchSide(IntEnum):
|
|
116
|
-
"""Branch Sides"""
|
|
117
|
-
|
|
118
|
-
from_side = 0
|
|
119
|
-
to_side = 1
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
class Branch3Side(IntEnum):
|
|
123
|
-
"""Branch3 Sides"""
|
|
124
|
-
|
|
125
|
-
side_1 = 0
|
|
126
|
-
side_2 = 1
|
|
127
|
-
side_3 = 2
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
class MeasuredTerminalType(IntEnum):
|
|
131
|
-
"""The type of asset measured by a (power) sensor"""
|
|
132
|
-
|
|
133
|
-
branch_from = 0
|
|
134
|
-
"""
|
|
135
|
-
Measuring the from-terminal between a branch (except link) and a node
|
|
136
|
-
"""
|
|
137
|
-
branch_to = 1
|
|
138
|
-
"""
|
|
139
|
-
Measuring the to-terminal between a branch (except link) and a node
|
|
140
|
-
"""
|
|
141
|
-
source = 2
|
|
142
|
-
"""
|
|
143
|
-
Measuring the terminal between a source and a node
|
|
144
|
-
"""
|
|
145
|
-
shunt = 3
|
|
146
|
-
"""
|
|
147
|
-
Measuring the terminal between a shunt and a node
|
|
148
|
-
"""
|
|
149
|
-
load = 4
|
|
150
|
-
"""
|
|
151
|
-
Measuring the terminal between a load and a node
|
|
152
|
-
"""
|
|
153
|
-
generator = 5
|
|
154
|
-
"""
|
|
155
|
-
Measuring the terminal between a generator and a node
|
|
156
|
-
"""
|
|
157
|
-
branch3_1 = 6
|
|
158
|
-
"""
|
|
159
|
-
Measuring the terminal-1 between a branch3 and a node
|
|
160
|
-
"""
|
|
161
|
-
branch3_2 = 7
|
|
162
|
-
"""
|
|
163
|
-
Measuring the terminal-2 between a branch3 and a node
|
|
164
|
-
"""
|
|
165
|
-
branch3_3 = 8
|
|
166
|
-
"""
|
|
167
|
-
Measuring the terminal-3 between a branch3 and a node
|
|
168
|
-
"""
|
|
169
|
-
node = 9
|
|
170
|
-
"""
|
|
171
|
-
Measuring the total power injection into a node
|
|
172
|
-
"""
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
class FaultType(IntEnum):
|
|
176
|
-
"""The type of fault represented by a fault component"""
|
|
177
|
-
|
|
178
|
-
three_phase = 0
|
|
179
|
-
single_phase_to_ground = 1
|
|
180
|
-
two_phase = 2
|
|
181
|
-
two_phase_to_ground = 3
|
|
182
|
-
nan = -128
|
|
183
|
-
"""
|
|
184
|
-
Unspecified fault type. Needs to be overloaded at the latest in the update_data
|
|
185
|
-
"""
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
class FaultPhase(IntEnum):
|
|
189
|
-
"""The faulty phase(s) affected by the provided fault type"""
|
|
190
|
-
|
|
191
|
-
abc = 0
|
|
192
|
-
"""
|
|
193
|
-
All phases are faulty in a three-phase fault
|
|
194
|
-
"""
|
|
195
|
-
a = 1
|
|
196
|
-
"""
|
|
197
|
-
The first phase is faulty in a single-phase-to-ground fault
|
|
198
|
-
"""
|
|
199
|
-
b = 2
|
|
200
|
-
"""
|
|
201
|
-
The second phase is faulty in a single-phase-to-ground fault
|
|
202
|
-
"""
|
|
203
|
-
c = 3
|
|
204
|
-
"""
|
|
205
|
-
The third phase is faulty in a single-phase-to-ground fault
|
|
206
|
-
"""
|
|
207
|
-
ab = 4
|
|
208
|
-
"""
|
|
209
|
-
The first and second phase are faulty in a two-phase or two-phase-to-ground fault
|
|
210
|
-
"""
|
|
211
|
-
ac = 5
|
|
212
|
-
"""
|
|
213
|
-
The first and third phase are faulty in a two-phase or two-phase-to-ground fault
|
|
214
|
-
"""
|
|
215
|
-
bc = 6
|
|
216
|
-
"""
|
|
217
|
-
The second and third phase are faulty in a two-phase or two-phase-to-ground fault
|
|
218
|
-
"""
|
|
219
|
-
default_value = -1
|
|
220
|
-
"""
|
|
221
|
-
Use the default fault phase. Depends on the fault_type.
|
|
222
|
-
"""
|
|
223
|
-
nan = -128
|
|
224
|
-
"""
|
|
225
|
-
Unspecified fault phase. Needs to be overloaded at the latest in the update_data
|
|
226
|
-
"""
|
|
1
|
+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
Common enumerations for library-internal use.
|
|
7
|
+
|
|
8
|
+
Note: these enumeration match the C++ arithmetic core, so don't change the values unless you change them in C++ as well
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from enum import IntEnum
|
|
13
|
+
|
|
14
|
+
# Value names are defined in lower case instead of upper case
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class CalculationType(IntEnum):
|
|
18
|
+
"""Calculation Types"""
|
|
19
|
+
|
|
20
|
+
power_flow = 0
|
|
21
|
+
state_estimation = 1
|
|
22
|
+
short_circuit = 2
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class CalculationMethod(IntEnum):
|
|
26
|
+
"""Calculation Methods"""
|
|
27
|
+
|
|
28
|
+
linear = 0
|
|
29
|
+
newton_raphson = 1
|
|
30
|
+
iterative_linear = 2
|
|
31
|
+
iterative_current = 3
|
|
32
|
+
linear_current = 4
|
|
33
|
+
iec60909 = 5
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class TapChangingStrategy(IntEnum):
|
|
37
|
+
"""Tap Changing Strategies"""
|
|
38
|
+
|
|
39
|
+
disabled = 0
|
|
40
|
+
"""
|
|
41
|
+
Disable automatic tap adjustment
|
|
42
|
+
"""
|
|
43
|
+
any_valid_tap = 1
|
|
44
|
+
"""
|
|
45
|
+
Adjust tap position automatically; optimize for any value in the voltage band
|
|
46
|
+
"""
|
|
47
|
+
min_voltage_tap = 2
|
|
48
|
+
"""
|
|
49
|
+
Adjust tap position automatically; optimize for the lower end of the voltage band
|
|
50
|
+
"""
|
|
51
|
+
max_voltage_tap = 3
|
|
52
|
+
"""
|
|
53
|
+
Adjust tap position automatically; optimize for the higher end of the voltage band
|
|
54
|
+
"""
|
|
55
|
+
fast_any_tap = 4
|
|
56
|
+
"""
|
|
57
|
+
Adjust tap position automatically; optimize for any value in the voltage band; binary search
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class AngleMeasurementType(IntEnum):
|
|
62
|
+
"""The type of the angle measurement for current sensors."""
|
|
63
|
+
|
|
64
|
+
local_angle = 0
|
|
65
|
+
"""
|
|
66
|
+
The angle is relative to the local voltage angle
|
|
67
|
+
"""
|
|
68
|
+
global_angle = 1
|
|
69
|
+
"""
|
|
70
|
+
The angle is relative to the global voltage angle.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class ShortCircuitVoltageScaling(IntEnum):
|
|
75
|
+
"""Voltage scaling for short circuit calculations"""
|
|
76
|
+
|
|
77
|
+
minimum = 0
|
|
78
|
+
maximum = 1
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class _ExperimentalFeatures(IntEnum):
|
|
82
|
+
"""Experimental features"""
|
|
83
|
+
|
|
84
|
+
disabled = 0
|
|
85
|
+
enabled = 1
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class ComponentAttributeFilterOptions(IntEnum):
|
|
89
|
+
"""Filter option component or attribute"""
|
|
90
|
+
|
|
91
|
+
everything = 0
|
|
92
|
+
"""Filter all components/attributes"""
|
|
93
|
+
relevant = 1
|
|
94
|
+
"""Filter only non-empty components/attributes that contain non-NaN values"""
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class LoadGenType(IntEnum):
|
|
98
|
+
"""Load and Generator Types"""
|
|
99
|
+
|
|
100
|
+
const_power = 0
|
|
101
|
+
const_impedance = 1
|
|
102
|
+
const_current = 2
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class WindingType(IntEnum):
|
|
106
|
+
"""Transformer Winding Types"""
|
|
107
|
+
|
|
108
|
+
wye = 0
|
|
109
|
+
wye_n = 1
|
|
110
|
+
delta = 2
|
|
111
|
+
zigzag = 3
|
|
112
|
+
zigzag_n = 4
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class BranchSide(IntEnum):
|
|
116
|
+
"""Branch Sides"""
|
|
117
|
+
|
|
118
|
+
from_side = 0
|
|
119
|
+
to_side = 1
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class Branch3Side(IntEnum):
|
|
123
|
+
"""Branch3 Sides"""
|
|
124
|
+
|
|
125
|
+
side_1 = 0
|
|
126
|
+
side_2 = 1
|
|
127
|
+
side_3 = 2
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class MeasuredTerminalType(IntEnum):
|
|
131
|
+
"""The type of asset measured by a (power) sensor"""
|
|
132
|
+
|
|
133
|
+
branch_from = 0
|
|
134
|
+
"""
|
|
135
|
+
Measuring the from-terminal between a branch (except link) and a node
|
|
136
|
+
"""
|
|
137
|
+
branch_to = 1
|
|
138
|
+
"""
|
|
139
|
+
Measuring the to-terminal between a branch (except link) and a node
|
|
140
|
+
"""
|
|
141
|
+
source = 2
|
|
142
|
+
"""
|
|
143
|
+
Measuring the terminal between a source and a node
|
|
144
|
+
"""
|
|
145
|
+
shunt = 3
|
|
146
|
+
"""
|
|
147
|
+
Measuring the terminal between a shunt and a node
|
|
148
|
+
"""
|
|
149
|
+
load = 4
|
|
150
|
+
"""
|
|
151
|
+
Measuring the terminal between a load and a node
|
|
152
|
+
"""
|
|
153
|
+
generator = 5
|
|
154
|
+
"""
|
|
155
|
+
Measuring the terminal between a generator and a node
|
|
156
|
+
"""
|
|
157
|
+
branch3_1 = 6
|
|
158
|
+
"""
|
|
159
|
+
Measuring the terminal-1 between a branch3 and a node
|
|
160
|
+
"""
|
|
161
|
+
branch3_2 = 7
|
|
162
|
+
"""
|
|
163
|
+
Measuring the terminal-2 between a branch3 and a node
|
|
164
|
+
"""
|
|
165
|
+
branch3_3 = 8
|
|
166
|
+
"""
|
|
167
|
+
Measuring the terminal-3 between a branch3 and a node
|
|
168
|
+
"""
|
|
169
|
+
node = 9
|
|
170
|
+
"""
|
|
171
|
+
Measuring the total power injection into a node
|
|
172
|
+
"""
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class FaultType(IntEnum):
|
|
176
|
+
"""The type of fault represented by a fault component"""
|
|
177
|
+
|
|
178
|
+
three_phase = 0
|
|
179
|
+
single_phase_to_ground = 1
|
|
180
|
+
two_phase = 2
|
|
181
|
+
two_phase_to_ground = 3
|
|
182
|
+
nan = -128
|
|
183
|
+
"""
|
|
184
|
+
Unspecified fault type. Needs to be overloaded at the latest in the update_data
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class FaultPhase(IntEnum):
|
|
189
|
+
"""The faulty phase(s) affected by the provided fault type"""
|
|
190
|
+
|
|
191
|
+
abc = 0
|
|
192
|
+
"""
|
|
193
|
+
All phases are faulty in a three-phase fault
|
|
194
|
+
"""
|
|
195
|
+
a = 1
|
|
196
|
+
"""
|
|
197
|
+
The first phase is faulty in a single-phase-to-ground fault
|
|
198
|
+
"""
|
|
199
|
+
b = 2
|
|
200
|
+
"""
|
|
201
|
+
The second phase is faulty in a single-phase-to-ground fault
|
|
202
|
+
"""
|
|
203
|
+
c = 3
|
|
204
|
+
"""
|
|
205
|
+
The third phase is faulty in a single-phase-to-ground fault
|
|
206
|
+
"""
|
|
207
|
+
ab = 4
|
|
208
|
+
"""
|
|
209
|
+
The first and second phase are faulty in a two-phase or two-phase-to-ground fault
|
|
210
|
+
"""
|
|
211
|
+
ac = 5
|
|
212
|
+
"""
|
|
213
|
+
The first and third phase are faulty in a two-phase or two-phase-to-ground fault
|
|
214
|
+
"""
|
|
215
|
+
bc = 6
|
|
216
|
+
"""
|
|
217
|
+
The second and third phase are faulty in a two-phase or two-phase-to-ground fault
|
|
218
|
+
"""
|
|
219
|
+
default_value = -1
|
|
220
|
+
"""
|
|
221
|
+
Use the default fault phase. Depends on the fault_type.
|
|
222
|
+
"""
|
|
223
|
+
nan = -128
|
|
224
|
+
"""
|
|
225
|
+
Unspecified fault phase. Needs to be overloaded at the latest in the update_data
|
|
226
|
+
"""
|