MCPcopy
hub / github.com/NVlabs/SPADE / save_options

Method save_options

options/base_options.py:122–133  ·  view source on GitHub ↗
(self, opt)

Source from the content-addressed store, hash-verified

120 return file_name
121
122 def save_options(self, opt):
123 file_name = self.option_file_path(opt, makedir=True)
124 with open(file_name + '.txt', 'wt') as opt_file:
125 for k, v in sorted(vars(opt).items()):
126 comment = ''
127 default = self.parser.get_default(k)
128 if v != default:
129 comment = '\t[default: %s]' % str(default)
130 opt_file.write('{:>25}: {:<30}{}\n'.format(str(k), str(v), comment))
131
132 with open(file_name + '.pkl', 'wb') as opt_file:
133 pickle.dump(opt, opt_file)
134
135 def update_options_from_file(self, parser, opt):
136 new_opt = self.load_options(opt)

Callers 1

parseMethod · 0.95

Calls 1

option_file_pathMethod · 0.95

Tested by

no test coverage detected