Skip to content

Remove the Dataset logic from PGM core, use DatasetHandler for MainModel #431

@TonyXiang8787

Description

@TonyXiang8787

Background

Currently we use Dataset as the input view for MainModel, such as:

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:

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

  1. Create export function in DatasetHandler to export a std::span for a single component.
  2. Remove export_dataset function in DatasetHandler.
  3. Change the constructor, get output, and update function of MainModel to receive range of a certain component type.
  4. 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

No one assigned

    Labels

    improvementImprovement on internal implementation

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions