power-grid-model 1.10.74__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.

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