|
101 | 101 | """
|
102 | 102 | A batch dataset is a dictionary where the keys are the component types and the values are :class:`BatchComponentData`
|
103 | 103 |
|
104 |
| -- Example: {"node": :class:`DenseBatchArray`, "line": :class:`SparseBatchArray`, |
105 |
| - "link": :class:`DenseBatchColumnarData`, "transformer": :class:`SparseBatchColumnarData`} |
| 104 | +- Example: { |
| 105 | + ComponentType.node: :class:`DenseBatchArray`, |
| 106 | + ComponentType.line: :class:`SparseBatchArray`, |
| 107 | + ComponentType.link: :class:`DenseBatchColumnarData`, |
| 108 | + ComponentType.transformer: :class:`SparseBatchColumnarData` |
| 109 | + } |
106 | 110 | """
|
107 | 111 |
|
108 | 112 | BatchList = _BatchList
|
109 | 113 | """
|
110 | 114 | A batch list is an alternative representation of a batch. It is a list of single datasets, where each single dataset
|
111 | 115 | is actually a batch. The batch list is intended as an intermediate data type, during conversions.
|
112 | 116 |
|
113 |
| -- Example: [:class:`SingleDataset`, {"node": :class:`SingleDataset`}] |
| 117 | +- Example: [:class:`SingleDataset`, {ComponentType.node: :class:`SingleDataset`}] |
114 | 118 | """
|
115 | 119 |
|
116 | 120 | BatchPythonDataset = _BatchPythonDataset
|
|
121 | 125 |
|
122 | 126 | - Example:
|
123 | 127 |
|
124 |
| - [{"line": [{"id": 3, "from_status": 0, "to_status": 0, ...}],}, |
125 |
| - {"line": [{"id": 3, "from_status": 1, "to_status": 1, ...}],}] |
| 128 | + [{ComponentType.line: [{"id": 3, "from_status": 0, "to_status": 0, ...}],}, |
| 129 | + {ComponentType.line: [{"id": 3, "from_status": 1, "to_status": 1, ...}],}] |
126 | 130 | """
|
127 | 131 |
|
128 | 132 | ColumnarData = _ColumnarData
|
|
162 | 166 |
|
163 | 167 | - Examples:
|
164 | 168 |
|
165 |
| - - single: {"node": :class:`SingleArray`, "line": :class:`SingleColumnarData`} |
| 169 | + - single: {ComponentType.node: :class:`SingleArray`, ComponentType.line: :class:`SingleColumnarData`} |
166 | 170 |
|
167 |
| - - batch: {"node": :class:`DenseBatchArray`, "line": :class:`SparseBatchArray`, |
168 |
| - "link": :class:`DenseBatchColumnarData`, "transformer": :class:`SparseBatchColumnarData`} |
| 171 | + - batch: { |
| 172 | + ComponentType.node: :class:`DenseBatchArray`, |
| 173 | + ComponentType.line: :class:`SparseBatchArray`, |
| 174 | + ComponentType.link: :class:`DenseBatchColumnarData`, |
| 175 | + ComponentType.transformer: :class:`SparseBatchColumnarData` |
| 176 | + } |
169 | 177 |
|
170 | 178 | """
|
171 | 179 |
|
|
216 | 224 | - single:
|
217 | 225 |
|
218 | 226 | {
|
219 |
| - "node": [{"id": 1, "u_rated": 10500.0}, {"id": 2, "u_rated": 10500.0}], |
220 |
| - "line": [{"id": 3, "from_node": 1, "to_node": 2, ...}], |
| 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, ...}], |
221 | 229 | }
|
222 | 230 |
|
223 | 231 | - batch:
|
224 | 232 |
|
225 |
| - [{"line": [{"id": 3, "from_status": 0, "to_status": 0, ...}],}, |
226 |
| - {"line": [{"id": 3, "from_status": 1, "to_status": 1, ...}],}] |
| 233 | + [{ComponentType.line: [{"id": 3, "from_status": 0, "to_status": 0, ...}],}, |
| 234 | + {ComponentType.line: [{"id": 3, "from_status": 1, "to_status": 1, ...}],}] |
227 | 235 | """
|
228 | 236 |
|
229 | 237 | RealValue = _RealValue
|
|
240 | 248 | - Examples:
|
241 | 249 |
|
242 | 250 | - structure: <1d-array>
|
243 |
| - - concrete: array([(0, 10500.0), (0, 10500.0)], dtype=power_grid_meta_data["input"]["node"].dtype) |
| 251 | + - concrete: array( |
| 252 | + [(0, 10500.0), (0, 10500.0)], |
| 253 | + dtype=power_grid_meta_data[DatasetType.input][ComponentType.node].dtype |
| 254 | + ) |
244 | 255 | """
|
245 | 256 |
|
246 | 257 | SingleColumn = _SingleColumn
|
|
253 | 264 | - structure: <1d-array>
|
254 | 265 | - concrete:
|
255 | 266 |
|
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]) |
| 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 | + ) |
258 | 272 | """
|
259 | 273 |
|
260 | 274 |
|
|
277 | 291 | A single dataset is a dictionary where the keys are the component types and the values are
|
278 | 292 | :class:`ComponentData`
|
279 | 293 |
|
280 |
| -- Example: {"node": :class:`SingleArray`, "line": :class:`SingleColumnarData`} |
| 294 | +- Example: {ComponentType.node: :class:`SingleArray`, ComponentType.line: :class:`SingleColumnarData`} |
281 | 295 | """
|
282 | 296 |
|
283 | 297 | SinglePythonDataset = _SinglePythonDataset
|
|
289 | 303 | - Example:
|
290 | 304 |
|
291 | 305 | {
|
292 |
| - "node": [{"id": 1, "u_rated": 10500.0}, {"id": 2, "u_rated": 10500.0}], |
293 |
| - "line": [{"id": 3, "from_node": 1, "to_node": 2, ...}], |
| 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, ...}], |
294 | 308 | }
|
295 | 309 | """
|
296 | 310 |
|
|
0 commit comments