flamapy / flamapy_fw

This repository hosts the main components of flamapy
4 stars 5 forks source link

Readers and writers for sample of configurations #123

Open jmhorcas opened 2 months ago

jmhorcas commented 2 months ago

Is your feature request related to a problem? Please describe. Need of reading and writing sample (lists) of configurations in a file.

Describe the solution you'd like I provide two different readers and two different writers available here:

  1. Configurations CSV Writer: This writes a list of configurations to a CSV file in the following format:

    Element1, Element2, Element3,..., ElementN
    True, True, False,..., True
    True, False, False,..., False
    True, True, True,..., True
    ...
  2. Configurations CSV Reader: This reads a list of configurations from a CSV file in the previous format.

  3. Configurations List Writer: This writes a list of configurations to a txt file in the folllowing format:

    ['Element1', 'Element2',..., 'ElementX']
    ['Element1', 'Element2',..., 'ElementY']
    ['Element1', 'Element2',..., 'ElementZ']
    ...

    where each list represents the selected elements in a configuration.

  4. Configurations List Reader: This reads a list of configurations in a txt file in the previous format.

Describe alternatives you've considered

Additional context

I just have also available a readers/writers for attributes in configurations. Let me know if you are interested in these other attributes readers/writers. See ConfigurationsAttributesReader

jagalindo commented 2 months ago

@jmhorcas how this differs from the currently available csvreader in the core? If the configurations are not fm configurations (the attributes one are). In other words they are just key value pairs, they belong to the core within the configuration metamodel. Otherwise, they belong to the fm metamodel.

jmhorcas commented 2 months ago

The different with the current CSVReader in the core is that it only reads one configuration per file. Thus, if you have 50 configurations you need 50 files. The readers I propose read a sample of configurations from a single file.

All the readers/writers I propose (including the attributes reader which is based on key-value pairs) are based on string "str" or "Any" types. Thus, the configuration are not FM configurations, nor the attributes.