czbenchmarks.utils
Attributes
Functions
|
Initialize Hydra configuration system. |
|
Import a class based on the _target_ field in a configuration file. |
Module Contents
- czbenchmarks.utils.logger
- czbenchmarks.utils.initialize_hydra(config_path='./conf')[source]
Initialize Hydra configuration system.
This function sets up Hydra’s configuration system using the specified configuration directory. If Hydra is already initialized, it clears the existing instance before reinitializing.
- Parameters:
config_path (str) – Path to the configuration directory.
- Returns:
None
- czbenchmarks.utils.import_class_from_config(config_path: str)[source]
Import a class based on the _target_ field in a configuration file.
This function reads a configuration file, extracts the _target_ field, and dynamically imports the specified class.
- Parameters:
config_path (str) – Path to the configuration file.
- Returns:
The imported class object.
- Return type:
class_obj
- Raises:
AttributeError – If the specified class does not exist in the module.
ImportError – If the module cannot be imported.