Skip to content

Commit

Permalink
Using sets to test whether each injection set has a pygrb_efficiency …
Browse files Browse the repository at this point in the history
…subsection in the configuration file
  • Loading branch information
pannarale committed Oct 16, 2024
1 parent 6a875f8 commit bbb21ee
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions bin/pygrb/pycbc_pygrb_results_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,10 @@ bank_file = _workflow.resolve_url_to_file(bank_file)

# Sanity check and File instances of the input injection files
inj_sets = wflow.cp.get_subsections('injections')
inj_sets.sort()
eff_secs = wflow.cp.get_subsections('pygrb_efficiency')
eff_secs.sort()
if eff_secs != inj_sets:
err_msg = "Each [injections] subsection requires a "
err_msg += "corresponding [pygrb_efficiency] subsection. "
if not set(inj_sets).issubset(eff_secs):
err_msg = "Each [injections] subsection requires at "
err_msg += "least one dedicated [pygrb_efficiency] subsection. "
err_msg += "[injections] subsections found: %s. "
err_msg += "[pygrb_efficiency] subsections found: %s. "
logging.error(err_msg, inj_sets, eff_secs)
Expand Down

0 comments on commit bbb21ee

Please sign in to comment.