bug in load_hdf5
Trying something like
import gwinc.io as io
traces = io.load_hdf5('QuantumRelGamma.h5')
usually works for me. However, when trying this on the attached file I get the following error:
---------------------------------------------------------------------------
ConstructorError Traceback (most recent call last)
<ipython-input-2-09781378b8b1> in <module>
----> 1 traces = io.load_hdf5('QuantumRelGamma.h5')
~/Documents/Research/GWdetectionCode/pygwinc/gwinc/io.py in load_hdf5(path)
142 with h5py.File(path, 'r') as f:
143 version = f.attrs.get('SCHEMA_VERSION', 1)
--> 144 return loaders[version](f)
~/Documents/Research/GWdetectionCode/pygwinc/gwinc/io.py in _load_hdf5_v2(f)
121 except yaml.constructor.ConstructorError:
122 logger.warning("HDF5 load warning: Could not de-serialize 'ifo' YAML attribute.")
--> 123 trace.plot_style = yaml.safe_load(attrs.get('plot_style', ''))
124 return trace
125
~/.local/lib/python3.7/site-packages/yaml/__init__.py in safe_load(stream)
160 to be safe for untrusted input.
161 """
--> 162 return load(stream, SafeLoader)
163
164 def safe_load_all(stream):
~/.local/lib/python3.7/site-packages/yaml/__init__.py in load(stream, Loader)
112 loader = Loader(stream)
113 try:
--> 114 return loader.get_single_data()
115 finally:
116 loader.dispose()
~/.local/lib/python3.7/site-packages/yaml/constructor.py in get_single_data(self)
41 node = self.get_single_node()
42 if node is not None:
---> 43 return self.construct_document(node)
44 return None
45
~/.local/lib/python3.7/site-packages/yaml/constructor.py in construct_document(self, node)
50 self.state_generators = []
51 for generator in state_generators:
---> 52 for dummy in generator:
53 pass
54 self.constructed_objects = {}
~/.local/lib/python3.7/site-packages/yaml/constructor.py in construct_yaml_map(self, node)
402 data = {}
403 yield data
--> 404 value = self.construct_mapping(node)
405 data.update(value)
406
~/.local/lib/python3.7/site-packages/yaml/constructor.py in construct_mapping(self, node, deep)
208 if isinstance(node, MappingNode):
209 self.flatten_mapping(node)
--> 210 return super().construct_mapping(node, deep=deep)
211
212 def construct_yaml_null(self, node):
~/.local/lib/python3.7/site-packages/yaml/constructor.py in construct_mapping(self, node, deep)
133 raise ConstructorError("while constructing a mapping", node.start_mark,
134 "found unhashable key", key_node.start_mark)
--> 135 value = self.construct_object(value_node, deep=deep)
136 mapping[key] = value
137 return mapping
~/.local/lib/python3.7/site-packages/yaml/constructor.py in construct_object(self, node, deep)
90 constructor = self.__class__.construct_mapping
91 if tag_suffix is None:
---> 92 data = constructor(self, node)
93 else:
94 data = constructor(self, tag_suffix, node)
~/.local/lib/python3.7/site-packages/yaml/constructor.py in construct_undefined(self, node)
418 raise ConstructorError(None, None,
419 "could not determine a constructor for the tag %r" % node.tag,
--> 420 node.start_mark)
421
422 SafeConstructor.add_constructor(
ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple'
in "<unicode string>", line 9, column 14:
ylim_limits: !!python/tuple
^