Loads the configuration from either a dict or a file. Args: config (dict or str): Either a dict containing the configuration information or the filename of a file containing the configuration information. Raises: TypeError: Raises a TypeError
(self, config: Union[dict, str])
| 152 | return self._config |
| 153 | |
| 154 | def load_config(self, config: Union[dict, str]): |
| 155 | """Loads the configuration from either a dict or a file. |
| 156 | |
| 157 | Args: |
| 158 | config (dict or str): Either a dict containing the configuration information or the filename |
| 159 | of a file containing the configuration information. |
| 160 | |
| 161 | Raises: |
| 162 | TypeError: Raises a TypeError if `config` is neither a dict nor a str. |
| 163 | """ |
| 164 | if isinstance(config, str): |
| 165 | self._config = Config.from_file(config) |
| 166 | elif isinstance(config, dict): |
| 167 | self._config = Config(config) |
| 168 | else: |
| 169 | raise TypeError("Invalid type for config, only dictionary or string is supported") |
| 170 | |
| 171 | def detect_num_processes_on_current_node(self): |
| 172 | hostname = socket.gethostname() |