From 8ab33d12a167fa612d6eec76ddf033171e3ca905 Mon Sep 17 00:00:00 2001 From: Michael Boniface <m.j.boniface@soton.ac.uk> Date: Thu, 20 Feb 2025 09:11:16 +0000 Subject: [PATCH] fixed empty output exception as it did not print the config file path --- acmc/phen.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acmc/phen.py b/acmc/phen.py index ad3b9f2..15c2e49 100644 --- a/acmc/phen.py +++ b/acmc/phen.py @@ -380,10 +380,10 @@ def preprocess(df, file, target_code_type=None, codes_file=None, translate=True, if target_code_type and not translate: # QA only on target codes - if target_code_type in file[columns]: + if target_code_type in file['columns']: logger.info(f"Processing {target_code_type} Codes...") out = preprocess_code(out=out, - codes=df[file[columns][target_code_type]].dropna(), + codes=df[file['columns'][target_code_type]].dropna(), codes_file=codes_file, checker=parse.code_types[target_code_type], output_col=target_code_type, @@ -534,7 +534,7 @@ def map(phen_dir, target_code_type, translate=True): # test if there's any output from processing if len(out.index) == 0: - raise Exception("The output after map processing has no output, check configuration file {str(config_path.resolve())} is not empty") + raise Exception(f"No output after map processing, check configuration {str(config_path.resolve())}") # Final processing out = out.reset_index(drop=True) -- GitLab