Skip to content

Commit

Permalink
Allow bytes in LVK injection format hdf
Browse files Browse the repository at this point in the history
I don't know if the file specification changed, or if someone changed from py2 to py3 without thinking, but this attribute is bytes in some of the examples we have been given
  • Loading branch information
GarethCabournDavies authored Aug 8, 2023
1 parent 32e0b90 commit f207edc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/pycbc_convertinjfiletohdf
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ if args.injection_file.endswith(('.xml', '.xml.gz', '.xmlgz')):
else:
# Assume a HDF file - check if new LVK format first
inj_file = h5py.File(args.injection_file, 'r')
if 'file_format' in inj_file.attrs:
if 'file_format' in inj_file.attrs or b'file_format' in inj_file.attrs:
# Assume LVK as PyCBC doesn't have this attribute
injclass = LVKNewStyleInjectionSet(args.injection_file)
inj_file.close()
Expand Down

0 comments on commit f207edc

Please sign in to comment.