Skip to content
Snippets Groups Projects
Commit 07137d74 authored by Jameson Rollins's avatar Jameson Rollins
Browse files

io: load_hdf5 don't fail if 'ifo' attribute can not be de-serialized

parent cb3a79c4
No related branches found
No related tags found
No related merge requests found
Pipeline #129699 passed
import h5py
import yaml
import datetime
from . import logger
from . import Struct
......@@ -72,5 +74,8 @@ def load_hdf5(path):
traces = _read_trace_recursive(f['/traces'])
attrs = dict(f.attrs)
if 'ifo' in attrs:
attrs['ifo'] = Struct.from_yaml(attrs['ifo'])
try:
attrs['ifo'] = Struct.from_yaml(attrs['ifo'])
except yaml.constructor.ConstructorError:
logger.warning("HDF5 load warning: Could not de-serialize 'ifo' YAML attribute.")
return freq, traces, attrs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment