def testRandint(self): arr = randint(1, 2, size=(10, 9), dtype='f8', density=.01, chunk_size=2).tiles() self.assertEqual(arr.shape, (10, 9)) self.assertEqual(len(arr.chunks), 25) self.assertEqual(arr.chunks[0].shape, (2, 2)) self.assertEqual(arr.chunks[0].op.dtype, np.float64) self.assertEqual(arr.chunks[0].op.low, 1) self.assertEqual(arr.chunks[0].op.high, 2) self.assertEqual(arr.chunks[0].op.density, .01)
def test_randint(): arr = tile( randint(1, 2, size=(10, 9), dtype='f8', density=.01, chunk_size=2)) assert arr.shape == (10, 9) assert len(arr.chunks) == 25 assert arr.chunks[0].shape == (2, 2) assert arr.chunks[0].op.dtype == np.float64 assert arr.chunks[0].op.low == 1 assert arr.chunks[0].op.high == 2 assert arr.chunks[0].op.density == .01