Skip to content

Commit

Permalink
Fixing check on input files (#4885)
Browse files Browse the repository at this point in the history
  • Loading branch information
pannarale authored Sep 24, 2024
1 parent 6142c52 commit 152014b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/pygrb/pycbc_pygrb_page_tables
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ qf_h5_outfile = opts.quiet_found_injs_h5_output_file
output_files = []

# Check for correct input
if [found_missed_file, onsource_file, offsource_file].count(None) != 2:
parser.error('Please provide one of --found-missed-file, ' +
'--onsource-file, or --offsource-file.')
if [found_missed_file, onsource_file].count(None) == 0:
parser.error('Please provide --found-missed-file to process injections, ' +
'--onsource-file to process the on-source, or neither of ' +
'them to process the off-source triggers.')
# The user may process injections...
elif found_missed_file is not None:
output_files = [qf_outfile, mf_outfile, qf_h5_outfile]
Expand All @@ -251,7 +252,8 @@ elif onsource_file is not None:
if None in output_files:
parser.error('Please provide both on-source output files ' +
'when using --onsource-file.')
# ...or triggers in the offsource (offsource_file is not None)
# ...or triggers in the offsource
# (both onsource_file and found_missed_file are None)
else:
output_files = [lofft_outfile, lofft_h5_outfile]
if None in output_files:
Expand Down

0 comments on commit 152014b

Please sign in to comment.