calibrain.utils.load_config#

calibrain.utils.load_config(config_file, logger=None)[source]#

Load the configuration from a YAML file.

Parameters:
  • config_file (str) – Path to the YAML configuration file.

  • logger (logging.Logger, optional) – Logger instance for logging messages. If None, a default logger will be created.

Raises:
  • FileNotFoundError – If the configuration file is not found.

  • yaml.YAMLError – If there is an error parsing the YAML file.

  • ValueError – If the configuration file is empty or invalid.

Returns:

config – The loaded configuration as a dictionary.

Return type:

dict