def get_result(self, output, i): m = re.search(r"FeatureFinderCentroided took (\d*\.?\d*) s \(wall\)", output) if m: t = float(m.group(1)) else: m = re.search(r"FeatureFinderCentroided took (\d\d):(\d\d) m \(wall\)", output) if m: t = float(m.group(1)) * 60 + float(m.group(2)) else: raise Exception("No result") opt = IDMapperOptimiser(self.config) opt.write_config(opt.working_ini_file) args = opt.get_args(i) output = opt.run_program(args, False) return {'value': opt.get_result(output, i), 'time': t}