Skip to content

inj_missed_found.py: add new_trigger func to predefine dict with all necessary columns

Rebecca Ewing requested to merge index-err into main

When running the test suite for PyCBC, the inj_missed_found job was periodically failing with the following error while trying to write out trigger data to Influx:

reduced_columns = {col: numpy.array(columns[col])[list(reduced_idx)].tolist() for col in columns.keys() if col not in column_key}
IndexError: index 1 is out of bounds for axis 0 with size 1
%4|1664471952.683|TERMINATE|rdkafka#producer-1| [thrd:app]: Producer terminating with 7 messages (357 bytes) still in queue or transit: use flush() to wait for outstanding message delivery

The cause of this was that some triggers were missing columns. I fixed this by initializing a dict for new triggers that has all necessary columns with a None value by default. This guarantees that all triggers will have an entry for each column, even if there is no value.

Merge request reports