Coverage for instanovo/utils/cli_utils.py: 100%
11 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-12-08 07:26 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2025-12-08 07:26 +0000
1from typing import List, Optional
3from omegaconf import DictConfig
5from instanovo.__init__ import console
6from instanovo.utils.colorlogging import ColorLog
8logger = ColorLog(console, __name__).logger
11def compose_config(
12 config_path: Optional[str] = None,
13 config_name: Optional[str] = None,
14 overrides: Optional[List[str]] = None,
15) -> DictConfig:
16 """Compose Hydra configuration with given overrides.
18 Args:
19 config_path: Relative path to config directory
20 config_name: Name of the base config file
21 overrides: List of Hydra override strings
23 Returns:
24 DictConfig: Composed configuration
25 """
26 from hydra import compose, initialize
28 logger.info(f"Reading config from '{config_path}' with name '{config_name}'.")
29 with initialize(config_path=config_path, version_base=None):
30 cfg = compose(config_name=config_name, overrides=overrides, return_hydra_config=False)
31 return cfg