Skip to content
Snippets Groups Projects
Commit 919c693e authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Bugfix: values of type Enum are now reconstructed with type Enum

parent 825590e1
No related branches found
No related tags found
1 merge request!22Draft: Implements metadata handling for bob.io.stream.Stream and bob.io.stream.StreamFile
Pipeline #60004 passed
......@@ -73,7 +73,7 @@ class MetaDatum:
"""
if not isinstance(value, self.dtype):
if isinstance(value, str) and isinstance(self._value, Enum): # reconstruct Enum value from name
self._value = type(self._value)[value]
value = type(self._value)[value]
# values that can't be saved using hdf5 types are saved as serialized values wrapped in numpy void type
elif isinstance(value, np.void):
value = pickle.loads(value.tobytes())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment