utils
canari_ml.hydra.utils
¶
canari_ml.hydra.utils.logger = logging.getLogger(__name__)
module-attribute
¶
canari_ml.hydra.utils.IndentDumper
¶
canari_ml.hydra.utils.get_hydra_config_root_path()
¶
canari_ml.hydra.utils.run_command(command)
¶
Run a command and log its output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
list
|
List of strings representing the command to execute. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the command exits with a non-zero return code. |
Source code in src/canari_ml/hydra/utils.py
canari_ml.hydra.utils.dynamic_import(path)
¶
Dynamically import a class or function from a module.
Takes a fully qualified name (e.g., 'module.class') and imports the specified class or function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
String containing the fully qualified name of the object to import, in the format 'module.class'. |
required |
Returns:
| Type | Description |
|---|---|
None
|
The imported class or function. |
Source code in src/canari_ml/hydra/utils.py
canari_ml.hydra.utils.print_omega_config(cfg, resolve=False)
¶
Print a HYDRA configuration as YAML.
This function converts the given OmegaConf DictionaryConfig to YAML format and logs it to stdout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
DictConfig
|
The Hydra configuration to print. |
required |