def test_nd_array(self): orig = np.arange(3) array = AsDataTypeArray(orig, '>f32') assert_array_equal(array.ndarray(), np.array([0, 1, 2], dtype='>f32'))
def test_nd_array(self): orig = np.arange(3) array = AsDataTypeArray(orig, '>f32') self.assertIsInstance(array.masked_array(), np.ma.masked_array) assert_array_equal(array.masked_array(), np.array([0, 1, 2], dtype='>f32'))
def test_nd_array(self): orig = np.arange(24) array = AsDataTypeArray(orig, '>f32') self.assertEqual(array.dtype, '>f32') self.assertIs(array.array, orig)