power-grid-model 1.10.17__py3-none-win_amd64.whl → 1.12.119__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.
Potentially problematic release.
This version of power-grid-model might be problematic. Click here for more details.
- power_grid_model/__init__.py +54 -29
- power_grid_model/_core/__init__.py +3 -3
- power_grid_model/_core/buffer_handling.py +507 -478
- power_grid_model/_core/data_handling.py +195 -141
- power_grid_model/_core/data_types.py +142 -0
- power_grid_model/_core/dataset_definitions.py +109 -109
- power_grid_model/_core/enum.py +226 -0
- power_grid_model/_core/error_handling.py +215 -198
- power_grid_model/_core/errors.py +134 -0
- power_grid_model/_core/index_integer.py +17 -17
- power_grid_model/_core/options.py +71 -69
- power_grid_model/_core/power_grid_core.py +577 -562
- power_grid_model/_core/power_grid_dataset.py +545 -490
- power_grid_model/_core/power_grid_meta.py +262 -244
- power_grid_model/_core/power_grid_model.py +1025 -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 +251 -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 +332 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h +1060 -0
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/handle.h +111 -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 +130 -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 +224 -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 +319 -317
- power_grid_model/_core/typing.py +20 -0
- power_grid_model/{_utils.py → _core/utils.py} +798 -783
- power_grid_model/data_types.py +321 -319
- power_grid_model/enum.py +27 -214
- power_grid_model/errors.py +37 -119
- power_grid_model/typing.py +43 -48
- power_grid_model/utils.py +529 -400
- power_grid_model/validation/__init__.py +25 -10
- power_grid_model/validation/{rules.py → _rules.py} +1167 -962
- power_grid_model/validation/{validation.py → _validation.py} +1172 -1015
- power_grid_model/validation/assertions.py +93 -92
- power_grid_model/validation/errors.py +602 -524
- power_grid_model/validation/utils.py +313 -318
- {power_grid_model-1.10.17.dist-info → power_grid_model-1.12.119.dist-info}/METADATA +162 -165
- power_grid_model-1.12.119.dist-info/RECORD +65 -0
- {power_grid_model-1.10.17.dist-info → power_grid_model-1.12.119.dist-info}/WHEEL +1 -1
- power_grid_model-1.12.119.dist-info/entry_points.txt +3 -0
- power_grid_model/_core/_power_grid_core.dll +0 -0
- power_grid_model-1.10.17.dist-info/RECORD +0 -32
- power_grid_model-1.10.17.dist-info/top_level.txt +0 -1
- {power_grid_model-1.10.17.dist-info → power_grid_model-1.12.119.dist-info/licenses}/LICENSE +0 -0
power_grid_model/data_types.py
CHANGED
|
@@ -1,319 +1,321 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
|
|
5
|
-
"""
|
|
6
|
-
Data types involving PGM datasets.
|
|
7
|
-
|
|
8
|
-
Many data types are used throughout the power grid model project. In an attempt to clarify type hints, some types
|
|
9
|
-
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
"""
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"""
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
"""
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
"""
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
"""
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
"""
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
"""
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
"""
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
"""
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
1
|
+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
Data types involving PGM datasets.
|
|
7
|
+
|
|
8
|
+
Many data types are used throughout the power grid model project. In an attempt to clarify type hints, some types
|
|
9
|
+
are defined/exposed and explained.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
# Import non class symbols as private to reassign and provide a docstring.
|
|
13
|
+
# Not necessary for class, as sphinx autodoc finds their docstrings
|
|
14
|
+
from power_grid_model._core.data_types import ( # noqa: F401
|
|
15
|
+
AsymValue as _AsymValue,
|
|
16
|
+
AttributeType as _AttributeType,
|
|
17
|
+
AttributeValue as _AttributeValue,
|
|
18
|
+
BatchArray as _BatchArray,
|
|
19
|
+
BatchColumn as _BatchColumn,
|
|
20
|
+
BatchColumnarData as _BatchColumnarData,
|
|
21
|
+
BatchComponentData as _BatchComponentData,
|
|
22
|
+
BatchDataset as _BatchDataset,
|
|
23
|
+
BatchList as _BatchList,
|
|
24
|
+
BatchPythonDataset as _BatchPythonDataset,
|
|
25
|
+
ColumnarData as _ColumnarData,
|
|
26
|
+
Component as _Component,
|
|
27
|
+
ComponentData as _ComponentData,
|
|
28
|
+
ComponentList as _ComponentList,
|
|
29
|
+
DataArray as _DataArray,
|
|
30
|
+
Dataset as _Dataset,
|
|
31
|
+
DenseBatchArray as _DenseBatchArray,
|
|
32
|
+
DenseBatchColumnarData as _DenseBatchColumnarData,
|
|
33
|
+
DenseBatchData as _DenseBatchData,
|
|
34
|
+
IndexPointer as _IndexPointer,
|
|
35
|
+
NominalValue as _NominalValue,
|
|
36
|
+
PythonDataset as _PythonDataset,
|
|
37
|
+
RealValue as _RealValue,
|
|
38
|
+
SingleArray as _SingleArray,
|
|
39
|
+
SingleColumn as _SingleColumn,
|
|
40
|
+
SingleColumnarData as _SingleColumnarData,
|
|
41
|
+
SingleComponentData as _SingleComponentData,
|
|
42
|
+
SingleDataset as _SingleDataset,
|
|
43
|
+
SinglePythonDataset as _SinglePythonDataset,
|
|
44
|
+
SparseBatchArray,
|
|
45
|
+
SparseBatchColumnarData,
|
|
46
|
+
SparseBatchData as _SparseBatchData,
|
|
47
|
+
SparseDataComponentType as _SparseDataComponentType,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
AsymValue = _AsymValue
|
|
51
|
+
"""
|
|
52
|
+
Asymmetrical values are three-phase values like p or u_measured.
|
|
53
|
+
|
|
54
|
+
- Example: (10400.0, 10500.0, 10600.0)
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
AttributeType = _AttributeType
|
|
58
|
+
"""
|
|
59
|
+
An attribute type is a string reprenting the attribute type of a specific component.
|
|
60
|
+
|
|
61
|
+
- Examples:
|
|
62
|
+
|
|
63
|
+
- "id"
|
|
64
|
+
- "u_rated"
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
AttributeValue = _AttributeValue
|
|
68
|
+
"""
|
|
69
|
+
When representing a grid as a native python structure, each attribute (u_rated etc) is either a nominal value,
|
|
70
|
+
a real value, or a tuple of three real values.
|
|
71
|
+
|
|
72
|
+
- Examples:
|
|
73
|
+
|
|
74
|
+
- real: 10500.0
|
|
75
|
+
- nominal: 123
|
|
76
|
+
- asym: (10400.0, 10500.0, 10600.0)
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
BatchArray = _BatchArray
|
|
80
|
+
"""
|
|
81
|
+
A batch array is a either a :class:`DenseBatchArray` or a :class:`SparseBatchArray`.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
BatchColumn = _BatchColumn
|
|
85
|
+
"""
|
|
86
|
+
A batch column is a two-dimensional structured numpy array containing a list of the same attribute of
|
|
87
|
+
multiple components of the same type. Otherwise, similar to :class:`SingleColumn`.
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
BatchColumnarData = _BatchColumnarData
|
|
91
|
+
"""
|
|
92
|
+
Batch columnar data is either a :class:`DenseBatchColumnarData` or a :class:`SparseBatchColumnarData`.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
BatchComponentData = _BatchComponentData
|
|
96
|
+
"""
|
|
97
|
+
Batch component data can be :class:`BatchArray` or :class:`BatchColumnarData`.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
BatchDataset = _BatchDataset
|
|
101
|
+
"""
|
|
102
|
+
A batch dataset is a dictionary where the keys are the component types and the values are :class:`BatchComponentData`
|
|
103
|
+
|
|
104
|
+
- Example: {
|
|
105
|
+
ComponentType.node: :class:`DenseBatchArray`,
|
|
106
|
+
ComponentType.line: :class:`SparseBatchArray`,
|
|
107
|
+
ComponentType.link: :class:`DenseBatchColumnarData`,
|
|
108
|
+
ComponentType.transformer: :class:`SparseBatchColumnarData`
|
|
109
|
+
}
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
BatchList = _BatchList
|
|
113
|
+
"""
|
|
114
|
+
A batch list is an alternative representation of a batch. It is a list of single datasets, where each single dataset
|
|
115
|
+
is actually a batch. The batch list is intended as an intermediate data type, during conversions.
|
|
116
|
+
|
|
117
|
+
- Example: [:class:`SingleDataset`, {ComponentType.node: :class:`SingleDataset`}]
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
BatchPythonDataset = _BatchPythonDataset
|
|
121
|
+
"""
|
|
122
|
+
A batch dataset in native python representation is a list of dictionaries, where the keys are the component names and
|
|
123
|
+
the values are a list of all the instances of such a component. In essence it stores the same information as a
|
|
124
|
+
BatchDataset, but in a native python format, without using numpy. Actually it looks more like the BatchList.
|
|
125
|
+
|
|
126
|
+
- Example:
|
|
127
|
+
|
|
128
|
+
[{ComponentType.line: [{"id": 3, "from_status": 0, "to_status": 0, ...}],},
|
|
129
|
+
{ComponentType.line: [{"id": 3, "from_status": 1, "to_status": 1, ...}],}]
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
ColumnarData = _ColumnarData
|
|
133
|
+
"""
|
|
134
|
+
Columnar data can be :class:`SingleColumnarData` or :class:`BatchColumnarData`.
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
Component = _Component
|
|
138
|
+
"""
|
|
139
|
+
A component, when represented in native python format, is a dictionary, where the keys are the attributes and the values
|
|
140
|
+
are the corresponding values. It is allowed to add extra fields, containing either an AttributeValue or a string.
|
|
141
|
+
|
|
142
|
+
- Example: {"id": 1, "u_rated": 10500.0, "original_id": "Busbar #1"}
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
ComponentData = _ComponentData
|
|
146
|
+
"""
|
|
147
|
+
Component data can be :class:`DataArray` or :class:`ColumnarData`.
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
ComponentList = _ComponentList
|
|
151
|
+
"""
|
|
152
|
+
A component list is a list containing components. In essence it stores the same information as a np.ndarray,
|
|
153
|
+
but in a native python format, without using numpy.
|
|
154
|
+
|
|
155
|
+
- Example: [{"id": 1, "u_rated": 10500.0}, {"id": 2, "u_rated": 10500.0}]
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
DataArray = _DataArray
|
|
159
|
+
"""
|
|
160
|
+
A data array can be a :class:`SingleArray` or a :class:`BatchArray`.
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
Dataset = _Dataset
|
|
164
|
+
"""
|
|
165
|
+
A general data set can be a :class:`SingleDataset` or a :class:`BatchDataset`.
|
|
166
|
+
|
|
167
|
+
- Examples:
|
|
168
|
+
|
|
169
|
+
- single: {ComponentType.node: :class:`SingleArray`, ComponentType.line: :class:`SingleColumnarData`}
|
|
170
|
+
|
|
171
|
+
- batch: {
|
|
172
|
+
ComponentType.node: :class:`DenseBatchArray`,
|
|
173
|
+
ComponentType.line: :class:`SparseBatchArray`,
|
|
174
|
+
ComponentType.link: :class:`DenseBatchColumnarData`,
|
|
175
|
+
ComponentType.transformer: :class:`SparseBatchColumnarData`
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
DenseBatchArray = _DenseBatchArray
|
|
181
|
+
"""
|
|
182
|
+
A dense batch array is a two-dimensional structured numpy array containing a list of components of
|
|
183
|
+
the same type for each scenario. Otherwise similar to :class:`SingleArray`.
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
DenseBatchColumnarData = _DenseBatchColumnarData
|
|
188
|
+
"""
|
|
189
|
+
Batch columnar data is a dictionary where the keys are the attribute types of the same component
|
|
190
|
+
and the values are :class:`BatchColumn`.
|
|
191
|
+
|
|
192
|
+
- Example: {"id": :class:`AttributeType`, "from_status": :class:`BatchColumn`}
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
DenseBatchData = _DenseBatchData
|
|
196
|
+
"""
|
|
197
|
+
Dense batch data can be a :class:`DenseBatchArray` or a :class:`DenseBatchColumnarData`.
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
IndexPointer = _IndexPointer
|
|
201
|
+
"""
|
|
202
|
+
An index pointer is a one-dimensional numpy int64 array containing n+1 elements where n is the amount
|
|
203
|
+
of scenarios, representing the start and end indices for each batch scenario as follows:
|
|
204
|
+
|
|
205
|
+
- The elements are the indices in the data that point to the first element of that scenario.
|
|
206
|
+
- The last element is one after the data index of the last element of the last scenario.
|
|
207
|
+
- The first element and last element will therefore be 0 and the size of the data, respectively.
|
|
208
|
+
"""
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
NominalValue = _NominalValue
|
|
212
|
+
"""
|
|
213
|
+
Nominal values can be IDs, booleans, enums, tap pos.
|
|
214
|
+
|
|
215
|
+
- Example: 123
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
PythonDataset = _PythonDataset
|
|
219
|
+
"""
|
|
220
|
+
A general python data set can be a single or a batch python dataset.
|
|
221
|
+
|
|
222
|
+
- Examples:
|
|
223
|
+
|
|
224
|
+
- single:
|
|
225
|
+
|
|
226
|
+
{
|
|
227
|
+
ComponentType.node: [{"id": 1, "u_rated": 10500.0}, {"id": 2, "u_rated": 10500.0}],
|
|
228
|
+
ComponentType.line: [{"id": 3, "from_node": 1, "to_node": 2, ...}],
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
- batch:
|
|
232
|
+
|
|
233
|
+
[{ComponentType.line: [{"id": 3, "from_status": 0, "to_status": 0, ...}],},
|
|
234
|
+
{ComponentType.line: [{"id": 3, "from_status": 1, "to_status": 1, ...}],}]
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
RealValue = _RealValue
|
|
238
|
+
"""
|
|
239
|
+
Symmetrical values can be anything like cable properties, symmetric loads, etc.
|
|
240
|
+
|
|
241
|
+
- Example: 10500.0
|
|
242
|
+
"""
|
|
243
|
+
|
|
244
|
+
SingleArray = _SingleArray
|
|
245
|
+
"""
|
|
246
|
+
A single array is a one-dimensional structured numpy array containing a list of components of the same type.
|
|
247
|
+
|
|
248
|
+
- Examples:
|
|
249
|
+
|
|
250
|
+
- structure: <1d-array>
|
|
251
|
+
- concrete: array(
|
|
252
|
+
[(0, 10500.0), (0, 10500.0)],
|
|
253
|
+
dtype=power_grid_meta_data[DatasetType.input][ComponentType.node].dtype
|
|
254
|
+
)
|
|
255
|
+
"""
|
|
256
|
+
|
|
257
|
+
SingleColumn = _SingleColumn
|
|
258
|
+
"""
|
|
259
|
+
A single column is a one-dimensional structured numpy array containing a list of the same attribute of
|
|
260
|
+
multiple components of the same type.
|
|
261
|
+
|
|
262
|
+
- Examples:
|
|
263
|
+
|
|
264
|
+
- structure: <1d-array>
|
|
265
|
+
- concrete:
|
|
266
|
+
|
|
267
|
+
- array([0, 1], dtype=power_grid_meta_data[DatasetType.input][ComponentType.node].dtype.fields["id"][0])
|
|
268
|
+
- array(
|
|
269
|
+
[10500.0, 10500.0],
|
|
270
|
+
dtype=power_grid_meta_data[DatasetType.input][ComponentType.node].dtype.fields["u_rated"][0]
|
|
271
|
+
)
|
|
272
|
+
"""
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
SingleColumnarData = _SingleColumnarData
|
|
276
|
+
"""
|
|
277
|
+
Single columnar data is a dictionary where the keys are the attribute types of the same component
|
|
278
|
+
and the values are :class:`SingleColumn`.
|
|
279
|
+
|
|
280
|
+
- Example: {"id": :class:`AttributeType`, "u_rated": :class:`SingleColumn`}
|
|
281
|
+
"""
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
SingleComponentData = _SingleComponentData
|
|
285
|
+
"""
|
|
286
|
+
Single component data can be :class:`SingleArray` or :class:`SingleColumnarData`.
|
|
287
|
+
"""
|
|
288
|
+
|
|
289
|
+
SingleDataset = _SingleDataset
|
|
290
|
+
"""
|
|
291
|
+
A single dataset is a dictionary where the keys are the component types and the values are
|
|
292
|
+
:class:`ComponentData`
|
|
293
|
+
|
|
294
|
+
- Example: {ComponentType.node: :class:`SingleArray`, ComponentType.line: :class:`SingleColumnarData`}
|
|
295
|
+
"""
|
|
296
|
+
|
|
297
|
+
SinglePythonDataset = _SinglePythonDataset
|
|
298
|
+
"""
|
|
299
|
+
A single dataset in native python representation is a dictionary, where the keys are the component names and the
|
|
300
|
+
values are a list of all the instances of such a component. In essence it stores the same information as a
|
|
301
|
+
SingleDataset, but in a native python format, without using numpy.
|
|
302
|
+
|
|
303
|
+
- Example:
|
|
304
|
+
|
|
305
|
+
{
|
|
306
|
+
ComponentType.node: [{"id": 1, "u_rated": 10500.0}, {"id": 2, "u_rated": 10500.0}],
|
|
307
|
+
ComponentType.line: [{"id": 3, "from_node": 1, "to_node": 2, ...}],
|
|
308
|
+
}
|
|
309
|
+
"""
|
|
310
|
+
|
|
311
|
+
SparseBatchData = _SparseBatchData
|
|
312
|
+
"""
|
|
313
|
+
Sparse batch data can be a :class:`SparseBatchArray` or a :class:`SparseBatchColumnarData`.
|
|
314
|
+
"""
|
|
315
|
+
|
|
316
|
+
SparseDataComponentType = _SparseDataComponentType
|
|
317
|
+
"""
|
|
318
|
+
A string representing the component type of sparse data structures.
|
|
319
|
+
|
|
320
|
+
Must be either "data" or "indptr".
|
|
321
|
+
"""
|