Skip to content

Commit

Permalink
Close the file after writing events. Not adding context manager as th…
Browse files Browse the repository at this point in the history
…e class is used only here.
  • Loading branch information
bhooshan-gadre committed Oct 2, 2023
1 parent 1b0a5da commit c4db510
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pycbc/events/eventmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def write_events(self, outname):
def write_to_hdf(self, outname):
class fw(object):
def __init__(self, name, prefix):
self.f = h5py.File(name, 'w')
self.f_name = name
self.prefix = prefix

def __setitem__(self, name, data):
Expand Down Expand Up @@ -551,6 +551,8 @@ def __setitem__(self, name, data):
f['gating/' + gate_type + '/pad'] = \
numpy.array([g[2] for g in gating_info[gate_type]])

f.f.close()


class EventManagerMultiDetBase(EventManager):
def __init__(self, opt, ifos, column, column_types, psd=None, **kwargs):
Expand Down

0 comments on commit c4db510

Please sign in to comment.