Commit d79e4232 authored by Leo Pound Singer's avatar Leo Pound Singer
Browse files

Permit duplicate coinc_def_ids case the input results from ligolw_adding multiple
LIGO-LW XML files.
Original: 0088b4c21bba9fe0d2df1b8c7b3084dc021c1cf2
parent 9dfdbac3
......@@ -123,10 +123,10 @@ def coinc_and_sngl_inspirals_for_xmldoc(xmldoc):
sngl_inspiral_table = ligolw_table.get_table(xmldoc, lsctables.SnglInspiralTable.tableName)
# Look up coinc_def id.
sngl_sngl_coinc_def_id = coinc_def_table.get_coinc_def_id(,
sngl_sngl_coinc_def_ids = set(row.coinc_def_id for row in coinc_def_table
if (, row.search_coinc_type) ==
# Indices to speed up lookups by ID.
key = operator.attrgetter('coinc_event_id')
......@@ -138,7 +138,7 @@ def coinc_and_sngl_inspirals_for_xmldoc(xmldoc):
# Loop over all sngl_inspiral <-> sngl_inspiral coincs.
for coinc in coinc_table:
if coinc.coinc_def_id == sngl_sngl_coinc_def_id:
if coinc.coinc_def_id in sngl_sngl_coinc_def_ids:
coinc_maps = coinc_maps_by_coinc_event_id[coinc.coinc_event_id]
yield coinc, tuple(sngl_inspirals_by_event_id[coinc_map.event_id]
for coinc_map in coinc_maps)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment