def test_numpy_scalar(self): scalar = np.int16(0) dtype = iadt.normalize_dtype(scalar) assert isinstance(dtype, np.dtype) assert dtype.name == "int16"
def test_ndarray(self): arr = np.zeros((1, ), dtype=np.int16) dtype = iadt.normalize_dtype(arr) assert isinstance(dtype, np.dtype) assert dtype.name == "int16"
def test_dtype_name_short(self): dtype = iadt.normalize_dtype("i2") assert isinstance(dtype, np.dtype) assert dtype.name == "int16"
def test_dtype_function(self): dtype = iadt.normalize_dtype(np.int16) assert isinstance(dtype, np.dtype) assert dtype.name == "int16"
def test_dtype(self): dtype = iadt.normalize_dtype(np.dtype("int16")) assert isinstance(dtype, np.dtype) assert dtype.name == "int16"