bessagroup / f3dasm

Framework for Data-Driven Design & Analysis of Structures & Materials (F3DASM)
https://f3dasm.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
111 stars 29 forks source link

Remove the naming discrepancy (`path_`) of referenced to_disk=True object #212

Closed mpvanderschelling closed 10 months ago

mpvanderschelling commented 10 months ago

Scenario

If you want to store the response of a data generator, you can either do that to_disk or not

See the documentation on ExperimentSample.store() for more information

In order to distinguish if a string as output is a reference or a literal string, the output parameter name is prefixed with path_.

The problem

When accessing a to_disk=True object, the name of the object is changed from <name> to path_<name>. This is confusing. The user of the dataset does not need to know if the output is referenced or not.

Possible solution

In the current version (v1.4.4), the names of the output parameters are stored in the private _Data object as headers of a pandas DataFrame. Pull request #211 already changed this so that the names are stored in a private _Columns object. This object does also hold information about if the output column is a reference or literal.

Upon creation of the output_parameter in the _Data object, this to_disk must be set accordingly and upon accessing the ExperimentSample, the data can be lazy loaded.

mpvanderschelling commented 10 months ago

The following solution has been implemented in #216:

Domain object and OutputParameter

Changes to ExperimentSample