power-grid-model
power-grid-model copied to clipboard
Remove the Dataset logic from PGM core, use DatasetHandler for MainModel
Background
Currently we use Dataset
as the input view for MainModel
, such as:
https://github.com/PowerGridModel/power-grid-model/blob/95212803cd9af486066deeea4d334b558ccf6e1a/power_grid_model_c/power_grid_model/include/power_grid_model/main_model.hpp#L101-L102
The C-API receives DatasetHandler
, we have a function to export to a Dataset
. See blow:
https://github.com/PowerGridModel/power-grid-model/blob/95212803cd9af486066deeea4d334b558ccf6e1a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/dataset_handler.hpp#L69-L71
This conversion is redundant. We already have DatasetHandler
which handles datasets.
Adjustments
- Create export function in
DatasetHandler
to export astd::span
for a single component. - Remove
export_dataset
function inDatasetHandler
. - Change the constructor, get output, and update function of
MainModel
to receiverange
of a certain component type. - Create a new class
OwningDataset
to contain owned buffers. This can be used for the validation test and later for the serialization-to-serialization API for the C-API. (msgpack
input ->msgpack
output).
@TonyXiang8787 how much of this is still relevant / unblocked with the new constexpr
metadata from #475 ?
@mgovers still quite relevant