Skip to content

Commit 79f2388

Browse files
committed
Fix dtype casting for strings in HDF5 saving to use bytes instead of string
1 parent 6596b4e commit 79f2388

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

face_rhythm/h5_handling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def make_h5_tree(dict_obj , h5_obj , group_string='', use_compression=False, tra
139139
else:
140140
## cast to 'S' type if string so that it doesn't become '|O' object type in h5 file
141141
if isinstance(val, str):
142-
val = np.array(val, dtype=np.string_)
142+
val = np.array(val, dtype=np.bytes_)
143143

144144
# print(f'saving: {group_string}: {key}')
145145
kwargs_compression = {'compression': 'gzip', 'compression_opts': 9} if use_compression else {}

0 commit comments

Comments
 (0)