tempor.config package

Subpackages

Module contents

Package directory for TemporAI configuration.

class tempor.config.LoggingConfig(level: str = '???', diagnose: bool = '???', backtrace: bool = '???', file_log: bool = '???')[source]

Bases: object

The configuration class for logging.

level : str = '???'

"DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL".

Type:

Logging level. One of

diagnose : bool = '???'

Whether to use loguru’s diagnose setting for exceptions.

backtrace : bool = '???'

Whether to use loguru’s backtrace setting for exceptions.

file_log : bool = '???'

Whether to log to a file.

class tempor.config.TemporConfig(logging: LoggingConfig, working_directory: str = '???')[source]

Bases: object

The main configuration class for the TemporAI library.

logging : LoggingConfig

Logging configuration.

working_directory : str = '???'

Working directory for the library. Can be set to a path string, "$PWD". or "~".

get_working_dir() str[source]

Get the working directory, with "$PWD" and "~" expanded.

Returns:

The working directory string.

Return type:

str

tempor.config.get_config() TemporConfig[source]

Get the current TemporAI configuration.

Returns:

TemporAI configuration.

Return type:

TemporConfig

tempor.config.load_yaml_file(path: str | Path) TemporConfig[source]

Load a YAML file as a TemporConfig object.

Parameters:
path : Union[str, pathlib.Path]

The path to the YAML file.

Returns:

TemporAI configuration.

Return type:

TemporConfig

tempor.config.load_dictconfig(config_node: DictConfig) TemporConfig[source]

Load an omegaconf.DictConfig as a TemporConfig object.

Parameters:
config_node : omegaconf.DictConfig

The configuration DictConfig.

Returns:

TemporAI configuration.

Return type:

TemporConfig

tempor.config.configure(new_config: TemporConfig | DictConfig | str | Path) TemporConfig[source]

Configure TemporAI with a new config.

Parameters:
new_config : Union[TemporConfig, omegaconf.DictConfig, str, pathlib.Path]

The new configuration. Can be a TemporConfig object, a DictConfig object, or a path to a YAML file.

Returns:

TemporAI configuration.

Return type:

TemporConfig