def get_keys_from_onefile(cls, name_file, path_keys, replace_func = None): """ Get concatenated keys from one res (passed as the name of the file)""" res = ut.eval_from_file(name_file, evfunc = pFunc_base.eval_with_pFunc, replace_func = replace_func) res_keys = "_".join([ut.extract_from_nested(res, k) for k in path_keys]) return res_keys
def get_keys_from_onefile_safe(cls, name_file, path_keys, replace_func = None): """ Get concatenated keys from one res (passed as the name of the file)""" try: res = ut.eval_from_file(name_file, evfunc = pFunc_base.eval_with_pFunc, replace_func = replace_func) res_keys = "_".join([ut.extract_from_nested(res, k) for k in path_keys]) except: print("Error reading file {}".format(name_file)) res_keys = None return res_keys
def eval_from_onefile(cls, name_file, replace_func = None): """ Get results from a file. Open a file and evaluate (with eval) its first element""" res = ut.eval_from_file(name_file, evfunc = pFunc_base.eval_with_pFunc,replace_func = replace_func) return res