Skip to content

Commit

Permalink
revert dtype list checks in validator
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince committed Sep 4, 2024
1 parent 21127c4 commit 4ca90ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hdmf/validate/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def get_type(data, builder_dtype=None):
# Case for h5py.Dataset and other I/O specific array types
else:
# Compound dtype
if builder_dtype and len(builder_dtype) > 1:
if builder_dtype and isinstance(builder_dtype, list):
dtypes = []
string_formats = []
for i in range(len(builder_dtype)):
Expand Down Expand Up @@ -441,7 +441,7 @@ def validate(self, **kwargs):
except EmptyArrayError:
# do not validate dtype of empty array. HDMF does not yet set dtype when writing a list/tuple
pass
if builder.dtype is not None and len(builder.dtype) > 1 and len(np.shape(builder.data)) == 0:
if isinstance(builder.dtype, list) and len(np.shape(builder.data)) == 0:
shape = () # scalar compound dataset
elif isinstance(builder.dtype, list):
shape = (len(builder.data), ) # only 1D datasets with compound types are supported
Expand Down

0 comments on commit 4ca90ce

Please sign in to comment.