activelearning.utils.config_loader

Attributes

ModelT

Functions

load_config(→ omegaconf.DictConfig)

Load and merge one or more YAML config files, then apply CLI overrides.

parse_config(→ ModelT)

load_and_parse(→ ModelT)

Module Contents

activelearning.utils.config_loader.ModelT
activelearning.utils.config_loader.load_config(
path: str | pathlib.Path | list[str | pathlib.Path],
overrides: list[str] | None = None,
) → omegaconf.DictConfig[source]

Load and merge one or more YAML config files, then apply CLI overrides.

Parameters:
  • path (str | Path | list[str | Path]) – A single YAML file path or an ordered list of paths. When a list is provided, files are merged left to right: later files override earlier ones for any shared keys.

  • overrides (list[str] | None) – OmegaConf dotlist overrides applied on top of the merged config, e.g. ["budget.available_budget=10", "sampler.num_samples=500"].

Returns:

The merged OmegaConf config object. Schema validation is performed separately via parse_config using a Pydantic model.

Return type:

DictConfig

activelearning.utils.config_loader.parse_config(cfg: omegaconf.DictConfig, model: type[ModelT]) → ModelT[source]
activelearning.utils.config_loader.load_and_parse(
path: str | pathlib.Path | list[str | pathlib.Path],
model: type[ModelT],
overrides: list[str] | None = None,
) → ModelT[source]