Skip to content

Commit a7fcc56

Browse files
committed
Fix int32 vlens being parsed as int64
1 parent ce5ae91 commit a7fcc56

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

h5pyd/_hl/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def __init__(
215215
# remove the trailing slash on endpoint if it exists
216216
if endpoint.endswith('/'):
217217
endpoint = endpoint.strip('/')
218-
218+
219219
if username is None:
220220
if "H5SERV_USERNAME" in os.environ:
221221
username = os.environ["H5SERV_USERNAME"]

h5pyd/_hl/h5type.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ def special_dtype(**kwds):
142142
name, val = kwds.popitem()
143143

144144
if name == 'vlen':
145-
146145
return np.dtype('O', metadata={'vlen': val})
147146

148147
if name == 'enum':
@@ -441,6 +440,10 @@ def getTypeItem(dt):
441440
type_info['length'] = 'H5T_VARIABLE'
442441
type_info['charSet'] = 'H5T_CSET_UTF8'
443442
type_info['strPad'] = 'H5T_STR_NULLTERM'
443+
elif vlen_check == np.int32:
444+
type_info['class'] = 'H5T_VLEN'
445+
type_info['size'] = 'H5T_VARIABLE'
446+
type_info['base'] = 'H5T_STD_I32'
444447
elif vlen_check in (int, np.int64):
445448
type_info['class'] = 'H5T_VLEN'
446449
type_info['size'] = 'H5T_VARIABLE'

0 commit comments

Comments
 (0)