Skip to content

Commit

Permalink
Fix int32 vlens being parsed as int64
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala committed Mar 27, 2024
1 parent ce5ae91 commit 7fef770
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion h5pyd/_hl/h5type.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def special_dtype(**kwds):
name, val = kwds.popitem()

if name == 'vlen':

return np.dtype('O', metadata={'vlen': val})

if name == 'enum':
Expand Down Expand Up @@ -441,6 +440,10 @@ def getTypeItem(dt):
type_info['length'] = 'H5T_VARIABLE'
type_info['charSet'] = 'H5T_CSET_UTF8'
type_info['strPad'] = 'H5T_STR_NULLTERM'
elif vlen_check == np.int32:
type_info['class'] = 'H5T_VLEN'
type_info['size'] = 'H5T_VARIABLE'
type_info['base'] = 'H5T_STD_I32'
elif vlen_check in (int, np.int64):
type_info['class'] = 'H5T_VLEN'
type_info['size'] = 'H5T_VARIABLE'
Expand Down

0 comments on commit 7fef770

Please sign in to comment.