Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 16, 2023
1 parent 82267ed commit f85165d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/hdmf/build/objectmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,17 @@ def __check_edgecases(cls, spec, value, spec_dtype): # noqa: C901
return value, cls.convert_dtype(spec, value.data, spec_dtype)[1]
if spec_dtype is None or spec_dtype == "numeric" or type(value) in cls.__no_convert:
# infer type from value
if hasattr(value, 'dtype'): # covers numpy types, Zarr Array, AbstractDataChunkIterator
if spec_dtype == 'numeric':
if hasattr(value, "dtype"): # covers numpy types, Zarr Array, AbstractDataChunkIterator
if spec_dtype == "numeric":
cls.__check_convert_numeric(value.dtype.type)
if np.issubdtype(value.dtype, np.str_):
ret_dtype = "utf8"
elif np.issubdtype(value.dtype, np.string_):
ret_dtype = 'ascii'
elif np.issubdtype(value.dtype, np.dtype('O')):
ret_dtype = "ascii"
elif np.issubdtype(value.dtype, np.dtype("O")):
# Only variable-length strings should ever appear as generic objects.
# Everything else should have a well-defined type
ret_dtype = 'utf8'
ret_dtype = "utf8"
else:
ret_dtype = value.dtype.type
return value, ret_dtype
Expand Down

0 comments on commit f85165d

Please sign in to comment.