def test_blocks01(self): r = bz_array.randfloat(5.0, 10.0, 10) b = 0 block = None for block in r.blocks: b += 1 self.assertEqual(b, 1) self.assertEqual(len(block), 10)
def test_sample02(self): r = bz_array.sample(bz_array.randfloat(5.0, 10.0, 200000), 100000) self.assertEqual(len(r.carray), 100000)
def test_randfloat02(self): r = bz_array.randfloat(10.0, 5.0, 10)
def test_randfloat01(self): r = bz_array.randfloat(1.0, 5.0, 10).carray self.assertEqual(len(r), 10) self.assertTrue(np.all(r[:] >= 1.0)) self.assertTrue(np.all(r[:] < 5.0))