-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
improvementImprovement on internal implementationImprovement on internal implementation
Description
Background
Currently we use Dataset
as the input view for MainModel
, such as:
power-grid-model/power_grid_model_c/power_grid_model/include/power_grid_model/main_model.hpp
Lines 101 to 102 in 9521280
explicit MainModelImpl(double system_frequency, ConstDataset const& input_data, Idx pos = 0) | |
: system_frequency_{system_frequency} { |
The C-API receives DatasetHandler
, we have a function to export to a Dataset
. See blow:
Lines 69 to 71 in 9521280
template <bool dataset_const> | |
std::map<std::string, DataPointer<dataset_const>> export_dataset(Idx scenario = -1) const | |
requires(dataset_const || data_mutable) |
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).
Metadata
Metadata
Assignees
Labels
improvementImprovement on internal implementationImprovement on internal implementation
Type
Projects
Status
No status