Skip to content

Commit 0978eed

Browse files
committed
ENH: Improve comment explaining alias check for strings
1 parent c213f30 commit 0978eed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nibabel/nifti1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,8 @@ def set_data_dtype(self, datatype):
21242124
>>> img.get_data_dtype() == np.dtype('int64')
21252125
True
21262126
"""
2127-
# Numpy dtype comparison can fail in odd ways, check for aliases only if str
2127+
# Comparing dtypes to strings, numpy will attempt to call, e.g., dtype('mask'),
2128+
# so only check for aliases if the type is a string
21282129
if isinstance(datatype, str):
21292130
# Static aliases
21302131
if datatype == 'mask':

0 commit comments

Comments
 (0)