Skip to content

Commit

Permalink
Fix convert dtype when writing numpy array from h5dataset (#427)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Tritt <ajtritt@lbl.gov>
  • Loading branch information
rly and ajtritt committed Oct 13, 2020
1 parent 0302e16 commit 4b774ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hdmf/build/objectmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __resolve_numeric_dtype(cls, given, specified):
"""
g = np.dtype(given)
s = np.dtype(specified)
if g is s:
if g == s:
return s.type, None
if g.itemsize <= s.itemsize: # given type has precision < precision of specified type
# note: this allows float32 -> int32, bool -> int8, int16 -> uint16 which may involve buffer overflows,
Expand Down

0 comments on commit 4b774ff

Please sign in to comment.