Skip to content

Add include functionality to allow for splitting of config files.

Abanti Ranadhir Sahasransu requested to merge SplitConfigFiles into master

DESCRIPTION:

The yaml config files to the various commands usually specified under the directory src/swatch/config can now be split over multiple files based on a top-level keyword and included into one file using the include keyword.

NB: The include keyword is a top-level keyword only (for now) and not meant to used as a sub-keyword for any of the sub-systems. The multiple system files need to be included in a single file or in other other words; a file that is included in another config file cannot have the include keyword itself.

Makes modification to the src/swatch/config.py file. Adds a function _parse_multiple_system_files(data, file_path=None) which

  • Check for duplication in top-level keywords between the multiple config files.
  • Adds the top-level keywords from multiple config files into a single dict.

Modifications make to parse_system_file() and parse_parameter_file() accordingly. A test performed with multiple system files and trials to check the errors was successful.

Closes #27 (closed).

Merge request reports