MCPcopy Create free account
hub / github.com/PowerGridModel/power-grid-model / columnar_array

Function columnar_array

tests/unit/test_data_handling.py:20–27  ·  view source on GitHub ↗
(component_type, n_components, attributes=None, batch_size_tuple=())

Source from the content-addressed store, hash-verified

18
19
20def columnar_array(component_type, n_components, attributes=None, batch_size_tuple=()):
21 component_dtype = power_grid_meta_data[DT.sym_output][component_type].dtype
22 required_attributes = (
23 set(component_dtype.names) & set(attributes) if attributes is not None else component_dtype.names
24 )
25 return {
26 attr: np.empty((n_components, *batch_size_tuple), dtype=component_dtype[attr]) for attr in required_attributes
27 }
28
29
30def row_array(component_type, n_components, batch_size_tuple=()):

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected