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