spine.config.load.load_config_file

spine.config.load.load_config_file(cfg_path: str, download: bool = True) Dict[str, Any][source]

Load a SPINE configuration from a file.

Convenience function that reads a configuration file and passes it to load_config. The file’s directory is automatically used as root_dir for include resolution.

Parameters:
  • cfg_path (str) – Path to configuration file

  • download (bool, default True) – If True, resolve !download tags by downloading files. If False, preserve !download tags as unresolved values.

Returns:

Loaded and merged configuration

Return type:

Dict[str, Any]

Raises:

Examples

>>> config = load_config_file("config.yaml")
>>> print(config['io']['reader']['batch_size'])
32

See also

load_config

Load config from a YAML string