Load opt from the config files, settings in later files can override those in previous files. Args: conf_files: config file path Returns: dict: a dictionary of opt settings
(conf_file)
| 27 | logger.warning(f"Overrided {k} from {ori_value} to {pointer[k_parts[-1]]}") |
| 28 | |
| 29 | def load_opt_from_config_file(conf_file): |
| 30 | """ |
| 31 | Load opt from the config files, settings in later files can override those in previous files. |
| 32 | |
| 33 | Args: |
| 34 | conf_files: config file path |
| 35 | |
| 36 | Returns: |
| 37 | dict: a dictionary of opt settings |
| 38 | """ |
| 39 | opt = {} |
| 40 | with open(conf_file, encoding='utf-8') as f: |
| 41 | config_dict = yaml.safe_load(f) |
| 42 | |
| 43 | load_config_dict_to_opt(opt, config_dict) |
| 44 | |
| 45 | return opt |
| 46 | |
| 47 | def load_opt_from_config_files(conf_files): |
| 48 | """ |
no test coverage detected