ertk.config.ERTKConfig
- class ertk.config.ERTKConfig
Bases:
ABCBase class for ERTK configuration dataclasses.
Methods
__init__()from_config(config)Create config object from any compatible config.
from_file(path[, override])Create config from YAML file and optionlly override some values.
merge_with_args([args])Merge config with command-line arguments.
Convert config to DictConfig.
to_file(path)Write config to YAML file.
Generate YAML string representation of config.
Inherited Methods
- classmethod from_config(config: Any) T
Create config object from any compatible config.
- Parameters:
- config: omegaconf.DictConfig or dict
The object to create the config from.
- Returns:
- ERKConfig
The resulting config.
- classmethod from_file(path: PathLike | str, override: List[str] | None = None) T
Create config from YAML file and optionlly override some values.
- Parameters:
- path: os.Pathlike or str
The path to YAML file containing config.
- override: list of str, optional
Argument overrides in the form of key=value pairs.
- Returns:
- ERKConfig
The resulting config.
- merge_with_args(args: List[str] | None = None) T
Merge config with command-line arguments.
- Parameters:
- args: list of str, optional
Argument overrides in the form of key=value pairs.
- Returns:
- ERKConfig
The resulting config.
- to_dictconfig() DictConfig
Convert config to DictConfig.
- Returns:
- omegaconf.DictConfig
The structured config which behaves like the corresponding dataclass.