diff --git a/src/hdmf/backends/hdf5/h5tools.py b/src/hdmf/backends/hdf5/h5tools.py index 23107e282..b0b18b952 100644 --- a/src/hdmf/backends/hdf5/h5tools.py +++ b/src/hdmf/backends/hdf5/h5tools.py @@ -924,8 +924,8 @@ def __resolve_dtype__(cls, dtype, data): # binary # number - # Use text dtype for Zarr datasets of strings. Zarr stores variable lenght strings - # as objects so we need to detect this special case here + # Use text dtype for Zarr datasets of strings. Zarr stores variable length strings + # as objects, so we need to detect this special case here if hasattr(data, 'attrs') and 'zarr_dtype' in data.attrs and data.attrs['zarr_dtype'] == 'str': return cls.__dtypes['text'] diff --git a/src/hdmf/build/objectmapper.py b/src/hdmf/build/objectmapper.py index 5d96eeddf..58dcf19f6 100644 --- a/src/hdmf/build/objectmapper.py +++ b/src/hdmf/build/objectmapper.py @@ -210,14 +210,14 @@ def convert_dtype(cls, spec, value, spec_dtype=None): # noqa: C901 (hasattr(value, 'astype') and hasattr(value, 'dtype'))): if spec_dtype_type is _unicode: if hasattr(value, 'attrs') and 'zarr_dtype' in value.attrs: - # Zarr stores strings as objects so we cannot convert to unicode dtype + # Zarr stores strings as objects, so we cannot convert to unicode dtype ret = value else: ret = value.astype('U') ret_dtype = "utf8" elif spec_dtype_type is _ascii: if hasattr(value, 'attrs') and 'zarr_dtype' in value.attrs: - # Zarr stores strings as objects so we cannot convert to unicode dtype + # Zarr stores strings as objects, so we cannot convert to unicode dtype ret = value else: ret = value.astype('S')