Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added user-readabe error messages for for wrong arguments #50

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/tests/test_data
*.pyc
*.DS_Store
*__pycache__*
*__pycache__*
*.egg-info
17 changes: 17 additions & 0 deletions pcpostprocess/scripts/run_herg_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("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
Expand Down Expand Up @@ -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:

Expand Down
Loading