def test_timeout_from_dt(): D = 400 v = 1 a = 0.1 r = sphere_vol_to_r(v) pores = fibonacci_spheres(1, r) t = escape(D, v, a, pores, max_steps=5, dt=1e-6) assert int(t) == 0
def test_escape(): D = 400 v = 1 a = 0.1 r = sphere_vol_to_r(v) pores = fibonacci_spheres(1, r) t = escape(D, v, a, pores, dt=1e-6) assert t
def test_avg_escape_sphere_time(): N = 10 D = 400 v = 1 a = 0.1 r = sphere_vol_to_r(v) pores = fibonacci_spheres(1, r) ts = np.mean([escape(D, v, a, pores, dt=1e-6) for _ in range(N)]) assert 0.001 < ts < 1
def test_fibo_spheres_inside(): assert in_sphere(fibonacci_spheres(P, V)[0], sphere_vol_to_r(V + eps))
def test_fibo_spheres_outside(): assert in_sphere(fibonacci_spheres(P, V)[0], sphere_vol_to_r(V - eps)) == False
def test_points_in_sphere(): assert in_sphere(fibonacci_spheres(1, 100)[0], 1) == False