Lines Matching refs:dtype

13     ld = np.dtype('longdouble')
14 return np.dtype({'names': ['bool_', 'uint_', 'float_', 'ldbl_'],
21 return np.dtype([('bool_', '?'), ('uint_', 'u4'), ('float_', 'f4'), ('ldbl_', 'g')])
33 ld = np.dtype('longdouble')
41 np.dtype('longdouble').itemsize, e='<' if byteorder == 'little' else '>')
45 return 12 + 4 * (np.dtype('uint64').alignment > 4) + 8 + 8 * (
46 np.dtype('longdouble').alignment > 8)
50 ld = np.dtype('longdouble')
56 ld = np.dtype('longdouble')
65 np.testing.assert_equal(actual, np.array(expected_data, dtype=expected_dtype))
73 ld = np.dtype('longdouble')
76 dbl = np.dtype('double')
113 d1 = np.dtype({'names': ['a', 'b'], 'formats': ['int32', 'float64'],
115 d2 = np.dtype([('a', 'i4'), ('b', 'f4')])
116 assert m.test_dtype_ctors() == [np.dtype('int32'), np.dtype('float64'),
117 np.dtype('bool'), d1, d1, np.dtype('uint32'), d2]
119 assert m.test_dtype_methods() == [np.dtype('int32'), simple_dtype, False, True,
120 np.dtype('int32').itemsize, simple_dtype.itemsize]
128 for func, dtype in [(m.create_rec_simple, simple_dtype), (m.create_rec_packed, packed_dtype)]:
130 assert arr.dtype == dtype
135 assert arr.dtype == dtype
139 if dtype == simple_dtype:
152 nested_dtype = np.dtype([('a', simple_dtype), ('b', packed_dtype)])
155 assert arr.dtype == nested_dtype
159 assert arr.dtype == nested_dtype
170 assert str(arr.dtype) == partial_dtype_fmt()
171 partial_dtype = arr.dtype
172 assert '' not in arr.dtype.fields
178 assert str(arr.dtype) == partial_nested_fmt()
179 assert '' not in arr.dtype.fields
180 assert '' not in arr.dtype.fields['a'][0].fields
181 assert arr.dtype.itemsize > partial_dtype.itemsize
186 data = np.arange(1, 7, dtype='int32')
197 assert str(arr.dtype) == "[('a', 'S3'), ('b', 'S3')]"
204 dtype = arr.dtype
208 assert dtype == arr.dtype
216 assert str(arr.dtype) == (
232 assert m.create_array_array(0).dtype == arr.dtype
240 dtype = arr.dtype
241 assert dtype == np.dtype([('e1', e + 'i8'), ('e2', 'u1')])
249 assert m.create_enum_array(0).dtype == dtype
257 dtype = arr.dtype
258 assert dtype == np.dtype([('cflt', e + 'c8'), ('cdbl', e + 'c16')])
266 assert m.create_complex_array(0).dtype == dtype
293 assert 'dtype is already registered' in str(excinfo.value)
303 assert d is np.dtype("f4")