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.
Files changed (67) hide show
  1. power_grid_model/__init__.py +54 -52
  2. power_grid_model/_core/__init__.py +3 -3
  3. power_grid_model/_core/buffer_handling.py +493 -478
  4. power_grid_model/_core/data_handling.py +195 -141
  5. power_grid_model/_core/data_types.py +143 -132
  6. power_grid_model/_core/dataset_definitions.py +109 -108
  7. power_grid_model/_core/enum.py +226 -226
  8. power_grid_model/_core/error_handling.py +206 -205
  9. power_grid_model/_core/errors.py +130 -126
  10. power_grid_model/_core/index_integer.py +17 -17
  11. power_grid_model/_core/options.py +71 -70
  12. power_grid_model/_core/power_grid_core.py +563 -581
  13. power_grid_model/_core/power_grid_dataset.py +535 -534
  14. power_grid_model/_core/power_grid_meta.py +257 -243
  15. power_grid_model/_core/power_grid_model.py +969 -687
  16. power_grid_model/_core/power_grid_model_c/__init__.py +3 -0
  17. power_grid_model/_core/power_grid_model_c/bin/power_grid_model_c.dll +0 -0
  18. power_grid_model/_core/power_grid_model_c/get_pgm_dll_path.py +63 -0
  19. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/basics.h +255 -0
  20. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/buffer.h +108 -0
  21. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/dataset.h +316 -0
  22. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h +1052 -0
  23. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/handle.h +99 -0
  24. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/meta_data.h +189 -0
  25. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/model.h +125 -0
  26. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/options.h +142 -0
  27. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/serialization.h +118 -0
  28. power_grid_model/_core/power_grid_model_c/include/power_grid_model_c.h +36 -0
  29. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/basics.hpp +65 -0
  30. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/buffer.hpp +61 -0
  31. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/dataset.hpp +220 -0
  32. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/handle.hpp +108 -0
  33. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/meta_data.hpp +84 -0
  34. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/model.hpp +63 -0
  35. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/options.hpp +52 -0
  36. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/serialization.hpp +124 -0
  37. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/utils.hpp +81 -0
  38. power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp.hpp +19 -0
  39. power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelConfig.cmake +37 -0
  40. power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelConfigVersion.cmake +65 -0
  41. power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelTargets-release.cmake +19 -0
  42. power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelTargets.cmake +144 -0
  43. power_grid_model/_core/power_grid_model_c/lib/power_grid_model_c.lib +0 -0
  44. power_grid_model/_core/power_grid_model_c/share/LICENSE +292 -0
  45. power_grid_model/_core/power_grid_model_c/share/README.md +15 -0
  46. power_grid_model/_core/serialization.py +317 -317
  47. power_grid_model/_core/typing.py +20 -20
  48. power_grid_model/_core/utils.py +798 -789
  49. power_grid_model/data_types.py +321 -307
  50. power_grid_model/enum.py +27 -27
  51. power_grid_model/errors.py +37 -37
  52. power_grid_model/typing.py +43 -43
  53. power_grid_model/utils.py +473 -465
  54. power_grid_model/validation/__init__.py +25 -25
  55. power_grid_model/validation/_rules.py +1171 -1175
  56. power_grid_model/validation/_validation.py +1172 -1158
  57. power_grid_model/validation/assertions.py +93 -93
  58. power_grid_model/validation/errors.py +602 -588
  59. power_grid_model/validation/utils.py +313 -321
  60. {power_grid_model-1.11.23.dist-info → power_grid_model-1.12.70.dist-info}/METADATA +178 -180
  61. power_grid_model-1.12.70.dist-info/RECORD +65 -0
  62. {power_grid_model-1.11.23.dist-info → power_grid_model-1.12.70.dist-info}/WHEEL +1 -1
  63. power_grid_model-1.12.70.dist-info/entry_points.txt +3 -0
  64. power_grid_model/_core/_power_grid_core.dll +0 -0
  65. power_grid_model-1.11.23.dist-info/RECORD +0 -36
  66. power_grid_model-1.11.23.dist-info/top_level.txt +0 -1
  67. {power_grid_model-1.11.23.dist-info → power_grid_model-1.12.70.dist-info}/licenses/LICENSE +0 -0
@@ -1,307 +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
- 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, I001
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: {"node": :class:`DenseBatchArray`, "line": :class:`SparseBatchArray`,
105
- "link": :class:`DenseBatchColumnarData`, "transformer": :class:`SparseBatchColumnarData`}
106
- """
107
-
108
- BatchList = _BatchList
109
- """
110
- A batch list is an alternative representation of a batch. It is a list of single datasets, where each single dataset
111
- is actually a batch. The batch list is intended as an intermediate data type, during conversions.
112
-
113
- - Example: [:class:`SingleDataset`, {"node": :class:`SingleDataset`}]
114
- """
115
-
116
- BatchPythonDataset = _BatchPythonDataset
117
- """
118
- A batch dataset in native python representation is a list of dictionaries, where the keys are the component names and
119
- the values are a list of all the instances of such a component. In essence it stores the same information as a
120
- BatchDataset, but in a native python format, without using numpy. Actually it looks more like the BatchList.
121
-
122
- - Example:
123
-
124
- [{"line": [{"id": 3, "from_status": 0, "to_status": 0, ...}],},
125
- {"line": [{"id": 3, "from_status": 1, "to_status": 1, ...}],}]
126
- """
127
-
128
- ColumnarData = _ColumnarData
129
- """
130
- Columnar data can be :class:`SingleColumnarData` or :class:`BatchColumnarData`.
131
- """
132
-
133
- Component = _Component
134
- """
135
- A component, when represented in native python format, is a dictionary, where the keys are the attributes and the values
136
- are the corresponding values. It is allowed to add extra fields, containing either an AttributeValue or a string.
137
-
138
- - Example: {"id": 1, "u_rated": 10500.0, "original_id": "Busbar #1"}
139
- """
140
-
141
- ComponentData = _ComponentData
142
- """
143
- Component data can be :class:`DataArray` or :class:`ColumnarData`.
144
- """
145
-
146
- ComponentList = _ComponentList
147
- """
148
- A component list is a list containing components. In essence it stores the same information as a np.ndarray,
149
- but in a native python format, without using numpy.
150
-
151
- - Example: [{"id": 1, "u_rated": 10500.0}, {"id": 2, "u_rated": 10500.0}]
152
- """
153
-
154
- DataArray = _DataArray
155
- """
156
- A data array can be a :class:`SingleArray` or a :class:`BatchArray`.
157
- """
158
-
159
- Dataset = _Dataset
160
- """
161
- A general data set can be a :class:`SingleDataset` or a :class:`BatchDataset`.
162
-
163
- - Examples:
164
-
165
- - single: {"node": :class:`SingleArray`, "line": :class:`SingleColumnarData`}
166
-
167
- - batch: {"node": :class:`DenseBatchArray`, "line": :class:`SparseBatchArray`,
168
- "link": :class:`DenseBatchColumnarData`, "transformer": :class:`SparseBatchColumnarData`}
169
-
170
- """
171
-
172
- DenseBatchArray = _DenseBatchArray
173
- """
174
- A dense batch array is a two-dimensional structured numpy array containing a list of components of
175
- the same type for each scenario. Otherwise similar to :class:`SingleArray`.
176
- """
177
-
178
-
179
- DenseBatchColumnarData = _DenseBatchColumnarData
180
- """
181
- Batch columnar data is a dictionary where the keys are the attribute types of the same component
182
- and the values are :class:`BatchColumn`.
183
-
184
- - Example: {"id": :class:`AttributeType`, "from_status": :class:`BatchColumn`}
185
- """
186
-
187
- DenseBatchData = _DenseBatchData
188
- """
189
- Dense batch data can be a :class:`DenseBatchArray` or a :class:`DenseBatchColumnarData`.
190
- """
191
-
192
- IndexPointer = _IndexPointer
193
- """
194
- An index pointer is a one-dimensional numpy int64 array containing n+1 elements where n is the amount
195
- of scenarios, representing the start and end indices for each batch scenario as follows:
196
-
197
- - The elements are the indices in the data that point to the first element of that scenario.
198
- - The last element is one after the data index of the last element of the last scenario.
199
- - The first element and last element will therefore be 0 and the size of the data, respectively.
200
- """
201
-
202
-
203
- NominalValue = _NominalValue
204
- """
205
- Nominal values can be IDs, booleans, enums, tap pos.
206
-
207
- - Example: 123
208
- """
209
-
210
- PythonDataset = _PythonDataset
211
- """
212
- A general python data set can be a single or a batch python dataset.
213
-
214
- - Examples:
215
-
216
- - single:
217
-
218
- {
219
- "node": [{"id": 1, "u_rated": 10500.0}, {"id": 2, "u_rated": 10500.0}],
220
- "line": [{"id": 3, "from_node": 1, "to_node": 2, ...}],
221
- }
222
-
223
- - batch:
224
-
225
- [{"line": [{"id": 3, "from_status": 0, "to_status": 0, ...}],},
226
- {"line": [{"id": 3, "from_status": 1, "to_status": 1, ...}],}]
227
- """
228
-
229
- RealValue = _RealValue
230
- """
231
- Symmetrical values can be anything like cable properties, symmetric loads, etc.
232
-
233
- - Example: 10500.0
234
- """
235
-
236
- SingleArray = _SingleArray
237
- """
238
- A single array is a one-dimensional structured numpy array containing a list of components of the same type.
239
-
240
- - Examples:
241
-
242
- - structure: <1d-array>
243
- - concrete: array([(0, 10500.0), (0, 10500.0)], dtype=power_grid_meta_data["input"]["node"].dtype)
244
- """
245
-
246
- SingleColumn = _SingleColumn
247
- """
248
- A single column is a one-dimensional structured numpy array containing a list of the same attribute of
249
- multiple components of the same type.
250
-
251
- - Examples:
252
-
253
- - structure: <1d-array>
254
- - concrete:
255
-
256
- - array([0, 1], dtype=power_grid_meta_data["input"]["node"].dtype.fields["id"][0])
257
- - array([10500.0, 10500.0], dtype=power_grid_meta_data["input"]["node"].dtype.fields["u_rated"][0])
258
- """
259
-
260
-
261
- SingleColumnarData = _SingleColumnarData
262
- """
263
- Single columnar data is a dictionary where the keys are the attribute types of the same component
264
- and the values are :class:`SingleColumn`.
265
-
266
- - Example: {"id": :class:`AttributeType`, "u_rated": :class:`SingleColumn`}
267
- """
268
-
269
-
270
- SingleComponentData = _SingleComponentData
271
- """
272
- Single component data can be :class:`SingleArray` or :class:`SingleColumnarData`.
273
- """
274
-
275
- SingleDataset = _SingleDataset
276
- """
277
- A single dataset is a dictionary where the keys are the component types and the values are
278
- :class:`ComponentData`
279
-
280
- - Example: {"node": :class:`SingleArray`, "line": :class:`SingleColumnarData`}
281
- """
282
-
283
- SinglePythonDataset = _SinglePythonDataset
284
- """
285
- A single dataset in native python representation is a dictionary, where the keys are the component names and the
286
- values are a list of all the instances of such a component. In essence it stores the same information as a
287
- SingleDataset, but in a native python format, without using numpy.
288
-
289
- - Example:
290
-
291
- {
292
- "node": [{"id": 1, "u_rated": 10500.0}, {"id": 2, "u_rated": 10500.0}],
293
- "line": [{"id": 3, "from_node": 1, "to_node": 2, ...}],
294
- }
295
- """
296
-
297
- SparseBatchData = _SparseBatchData
298
- """
299
- Sparse batch data can be a :class:`SparseBatchArray` or a :class:`SparseBatchColumnarData`.
300
- """
301
-
302
- SparseDataComponentType = _SparseDataComponentType
303
- """
304
- A string representing the component type of sparse data structures.
305
-
306
- Must be either "data" or "indptr".
307
- """
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
+ """