astrodata.utils package

Submodules

astrodata.utils.logger module

astrodata.utils.logger.setup_logger(name='astrodata', level=20)

Set up and return a logger with the specified name and level. Logs to stdout with a simple format.

Return type:

Logger

astrodata.utils.utils module

astrodata.utils.utils.get_output_path(project_path, subfolder, filename=None)
Return type:

Path

astrodata.utils.utils.read_config(config_path)

Reads a YAML configuration file and returns its contents as a dictionary. Ensures that a ‘project_path’ key exists and resolves it to an absolute path.

Parameters:

config_path (str) – The path to the YAML configuration file.

Returns:

The contents of the YAML file as a dictionary, with ‘project_path’ absolute.

Return type:

dict

Raises:

KeyError – If ‘project_path’ is missing in the config.

Module contents