compass.utilities.io.load_config#

load_config(config_filepath, resolve_paths=True, file_name='Configuration', excluded_keys=None)[source]#

Load a config file, recursively applying inherited configuration

Parameters:
  • config_filepath (path-like) – Path to config file.

  • resolve_paths (bool, default True) – Option to (recursively) resolve file-paths in the dictionary w.r.t the config file directory. By default, True.

  • file_name (str, default "Configuration") – Name of the config file for error messages. By default, “Configuration”.

  • excluded_keys (Iterable of str, optional) – Dictionary keys whose values should not be resolved as paths. By default, None.

Returns:

dict – Dictionary containing configuration parameters.

Raises:

Notes

A config may use inherit_from to name another config file. Parent configs are loaded recursively and dictionaries are deep-merged, with child values taking precedence. Lists are replaced, not combined. An exact child value of "DELETE" removes that key from the merged result. Parent references are relative to the file where they are defined. When path resolution is enabled, other relative paths are also resolved from their defining file.