load_config

specsim.config.load_config(name, config_type=<class 'specsim.config.Configuration'>)[source] [edit on github]

Load configuration data from a YAML file.

Valid configuration files are YAML files containing no custom types, no sequences (lists), and with all mapping (dict) keys being valid python identifiers.

Parameters:
namestr

Name of the configuration to load, which can either be a pre-defined name or else the name of a yaml file (with extension .yaml) to load. Pre-defined names are mapped to corresponding files in this package’s data/config/ directory.

Returns:
Configuration

Initialized configuration object.

Raises:
ValueError

File name has wrong extension or does not exist.

RuntimeError

Configuration data failed a validation test.