-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Columnar data creation helper function #786
Comments
decision: use |
To be clear: |
Update: This helper function would make assignment operations ambiguous for users. Hence it is now decided to have |
@nitbharambe Is this still open? |
A
initialize_column(data_type, component, shape, attributes, empty=False)
helper function which gives out columnar data ie. dict of arrays.Motivation:
We have
initialize_array
helper function to make users not bother about the dtype. A same one for columnar data.If the user has to create a columnar data now, they would have to do :
{k: v for k,v in initialize_array(dataset_type, component_type, shape).items()}
or
{k: np.empty(shape=..., dtype=power_grid_meta_data[dataset_type][component_type][k]) for k in attributes}
or some similar combination
Also in first way, user creates a huge array; subset of which is then converted to dictionary.
Options:
initialize_column(data_type, component, shape, attribute, empty=False) -> np.ndarray
initialize_columnar_data(data_type, component, shape, attributes, empty=False) -> dict[str, np.ndarray]
The text was updated successfully, but these errors were encountered: