From b68e6ac87da20e2cba426b436a12a1ee49e3fc1e Mon Sep 17 00:00:00 2001 From: anastasia-rk Date: Mon, 18 Nov 2024 16:57:25 +0000 Subject: [PATCH 1/3] added user-readabe error messages for for wrong arguments --- .gitignore | 4 +++- pcpostprocess/scripts/run_herg_qc.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4696f44..0a998c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /tests/test_data *.pyc *.DS_Store -*__pycache__* \ No newline at end of file +*__pycache__* +*.egg-info + diff --git a/pcpostprocess/scripts/run_herg_qc.py b/pcpostprocess/scripts/run_herg_qc.py index 7bb7979..5497731 100644 --- a/pcpostprocess/scripts/run_herg_qc.py +++ b/pcpostprocess/scripts/run_herg_qc.py @@ -87,6 +87,18 @@ def main(): else: wells = args.wells + # this warning addresses the error that occurs if a user inputs wrong data into args.wells + wrongWellNames = [well for well in wells if well not in all_wells] + if len(wrongWellNames) > 0: + if len(wrongWellNames) == len(wells): + logging.error(f"Specified well names are not in the list of available wells") + return + else: + logging.warning(f"Specified well names {wrongWellNames} are not in the list of available wells." + f"Removing them from the list of wells to be processed.") + wells = [well for well in wells if well not in wrongWellNames] + # other functions read args.wells later on, so we need to update it + args.wells = wells # Import and exec config file global export_config @@ -160,6 +172,11 @@ def main(): times_list.append([times[1], times[3]]) readnames.append(protocol) + # this error is raised if the user has not specified the dictionary of protocols in the export_config.py file + if not readnames: + logging.error("No compatible protocols found in export config file.") + return + with multiprocessing.Pool(min(args.no_cpus, len(readnames)), **pool_kws) as pool: From fc2a93527f418ebbeb526de9d78d9ea57f554391 Mon Sep 17 00:00:00 2001 From: anastasia-rk Date: Mon, 18 Nov 2024 17:22:57 +0000 Subject: [PATCH 2/3] typo fixed in error message. --- pcpostprocess/scripts/run_herg_qc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcpostprocess/scripts/run_herg_qc.py b/pcpostprocess/scripts/run_herg_qc.py index 5497731..d2c10db 100644 --- a/pcpostprocess/scripts/run_herg_qc.py +++ b/pcpostprocess/scripts/run_herg_qc.py @@ -91,7 +91,7 @@ def main(): wrongWellNames = [well for well in wells if well not in all_wells] if len(wrongWellNames) > 0: if len(wrongWellNames) == len(wells): - logging.error(f"Specified well names are not in the list of available wells") + logging.error("Specified well names are not in the list of available wells.") return else: logging.warning(f"Specified well names {wrongWellNames} are not in the list of available wells." From 203b3fadf6555075db2e75f64ec9c59b9c60dc06 Mon Sep 17 00:00:00 2001 From: joeyshuttleworth Date: Thu, 12 Dec 2024 14:03:33 +0000 Subject: [PATCH 3/3] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0a998c3..353c69e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,3 @@ *.DS_Store *__pycache__* *.egg-info -