MCPcopy Create free account
hub / github.com/SooLab/CGFormer / load_cfg_from_cfg_file

Function load_cfg_from_cfg_file

utils/config.py:61–74  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

59
60
61def load_cfg_from_cfg_file(file):
62 cfg = {}
63 assert os.path.isfile(file) and file.endswith('.yaml'), \
64 '{} is not a yaml file'.format(file)
65
66 with open(file, 'r') as f:
67 cfg_from_file = yaml.safe_load(f)
68
69 for key in cfg_from_file:
70 for k, v in cfg_from_file[key].items():
71 cfg[k] = v
72
73 cfg = CfgNode(cfg)
74 return cfg
75
76
77def merge_cfg_from_list(cfg, cfg_list):

Callers

nothing calls this directly

Calls 2

CfgNodeClass · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected