Commit 07137d74 authored by Jameson Rollins's avatar Jameson Rollins

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

parent cb3a79c4
Pipeline #129699 passed with stages
in 2 minutes and 50 seconds
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment