MCPcopy Create free account
hub / github.com/SegmentationBLWX/cssegmentation / parse

Method parse

csseg/modules/utils/configparser.py:39–49  ·  view source on GitHub ↗
(self, cfg_file_path)

Source from the content-addressed store, hash-verified

37 return cfg, cfg_file_path
38 '''parse'''
39 def parse(self, cfg_file_path):
40 # ext to parse method
41 ext_to_parse_method = {
42 '.py': self.parsefrompy, '.pkl': self.parsefrompkl,
43 }
44 # config ext
45 cfg_ext = os.path.splitext(cfg_file_path)[-1]
46 # assert
47 assert cfg_ext in ext_to_parse_method, f'unable to parse config with extension {cfg_ext}'
48 # parse
49 return ext_to_parse_method[cfg_ext](cfg_file_path=cfg_file_path)
50 '''save'''
51 def save(self, work_dir=''):
52 work_dir = os.path.join(work_dir, 'configs')

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected