From 4ca90ced44e4af78fe64918af88cddcd30a53e68 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Wed, 4 Sep 2024 00:15:55 -0700 Subject: [PATCH] revert dtype list checks in validator --- src/hdmf/validate/validator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hdmf/validate/validator.py b/src/hdmf/validate/validator.py index 2668da1ec..6ce211f96 100644 --- a/src/hdmf/validate/validator.py +++ b/src/hdmf/validate/validator.py @@ -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)): @@ -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