Skip to content

Commit

Permalink
Workaround for when there are zero length trigger files in the cache (#…
Browse files Browse the repository at this point in the history
…359)

Co-authored-by: Evan Goetz <evan.goetz@ligo.org>
  • Loading branch information
eagoetz and Evan Goetz authored Feb 23, 2023
1 parent b181be2 commit 9c88e63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gwsumm/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@ def read_cache(cache, segments, etg, nproc=1, timecolumn=None, **kwargs):
if etg == 'pycbc_live': # remove empty HDF5 files
cache = filter_pycbc_live_files(cache, ifo=kwargs['ifo'])

# Currently the EventTable.read() method fails if there are zero
# length trigger files in addition to non-zero length trigger files.
# Here, we read trigger files one-by-one and remove any with zero length
# from the cache list.
for idx, this_trigger_file in enumerate(cache):
this_table = EventTable.read(this_trigger_file, **kwargs)
if len(this_table) == 0:
cache.remove(this_trigger_file)
continue

if len(cache) == 0:
return

Expand Down

0 comments on commit 9c88e63

Please sign in to comment.