def test_rstate_kwarg(): """Test that rstate keyword argument works as expected.""" rstate = RandomState(123) a = nestle.randsphere(10, rstate=rstate) np.random.seed(123) b = nestle.randsphere(10) assert np.all(a == b)
def test_randsphere(): """Draw a lot of points and check that they're within a unit sphere. """ rstate = RandomState(0) npoints = 1000 for n in range(1, NMAX + 1): for i in range(npoints): x = nestle.randsphere(n, rstate=rstate) r = np.sum(x**2) assert r < 1.0
def test_randsphere(): """Draw a lot of points and check that they're within a unit sphere. """ rstate = RandomState(0) npoints = 1000 for n in range(1, NMAX+1): for i in range(npoints): x = nestle.randsphere(n, rstate=rstate) r = np.sum(x**2) assert r < 1.0