mlsteam_model_sdk.utils.config
Configuration utilities
Functions
|
Gets SDK configuration file path. |
|
Gets configuration value. |
|
Initializes SDK configuration file path. |
- mlsteam_model_sdk.utils.config.get_config_path(check: bool = False) Optional[Path]
Gets SDK configuration file path.
It performs configuration discovery if such a path has not been initialized. Discovery order: 1. current working directory 2. home directory 3. working directory upward
- Parameters:
check – whether to check configuation existence
- Returns:
path to the configuration file, or None if the file is not found and check is False
- Raises:
MissingConfigException – configuration is not found (when check is True)
- mlsteam_model_sdk.utils.config.get_value(option: str, section: Optional[str] = None)
Gets configuration value.
It initializes configuration implicitly if it has not been done.
- mlsteam_model_sdk.utils.config.init_config(path=None, check: bool = False)
Initializes SDK configuration file path.
This function is only effective at first time. It is NOP in subsequent calls.
NOTE: Some SDK functions initialize SDK configuration implicitly when it has not been done. To use a custom configuration path, it is adviced to call this function before any other SDK call.
- Parameters:
path – SDK configuration file path to set. When it is not given, configuration discovery is performed.
check – raises an exception when configuration discovery fails
- Raises:
MissingConfigException – configuration discovery fails (when check is True)