File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 36
36
def readtime_dtype (basetype , names ):
37
37
"""Make a NumPy dtype appropriate for reading"""
38
38
# Check if basetype is the special case for storing complex numbers
39
- if (
40
- basetype .names is not None
41
- and basetype .names == ("r" , "i" )
42
- and all (dt .kind == "f" for dt , off in basetype .fields .values ())
43
- and basetype .fields ["r" ][0 ] == basetype .fields ["i" ][0 ]
44
- ):
39
+ is_complex_basetype = basetype .names is not None and basetype .names == ("r" , "i" )
40
+ is_complex_basetype = is_complex_basetype and all (dt .kind == "f" for dt , off in basetype .fields .values ())
41
+ is_complex_basetype = is_complex_basetype and basetype .fields ["r" ][0 ] == basetype .fields ["i" ][0 ]
42
+ if is_complex_basetype :
45
43
itemsize = basetype .itemsize
46
44
if itemsize == 16 :
47
45
return numpy .dtype (numpy .complex128 )
Original file line number Diff line number Diff line change @@ -860,7 +860,7 @@ def createDataType(typeItem):
860
860
dtRet = np .dtype (dtName )
861
861
return dtRet # return predefined type
862
862
863
- if isinstance (typeItem , dict ) :
863
+ if type (typeItem ) is not dict :
864
864
raise TypeError ("invalid type" )
865
865
866
866
if 'class' not in typeItem :
You can’t perform that action at this time.
0 commit comments