Exemple #1
0
 def time_compute_distance2line(self):
     for _ in range(1000000):
         montecarlo.compute_distance2line_wrapper(
             2.20866912e15,
             -0.251699059004,
             1.05581082105e15,
             1.06020910733e15,
             1693440.0,
             5.90513983371e-07,
             1.0602263591e15,
             1.06011723237e15,
             2,
         )
         montecarlo.compute_distance2line_wrapper(
             2.23434667994e15,
             -0.291130548401,
             1.05581082105e15,
             1.06733618121e15,
             1693440.0,
             5.90513983371e-07,
             1.06738407486e15,
             1.06732933961e15,
             3,
         )
Exemple #2
0
def test_compute_distance2line():
    assert montecarlo.compute_distance2line_wrapper(2.20866912e+15, -0.251699059004, 1.05581082105e+15, 1.06020910733e+15, 1693440.0, 5.90513983371e-07, 1.0602263591e+15, 1.06011723237e+15, 2) == 344430881691490.5
    assert montecarlo.compute_distance2line_wrapper(2.23434667994e+15, -0.291130548401, 1.05581082105e+15, 1.06733618121e+15, 1693440.0, 5.90513983371e-07, 1.06738407486e+15, 1.06732933961e+15, 3) == 96296282395637.2
    with pytest.raises(RuntimeError):
        montecarlo.compute_distance2line_wrapper(1.0, 1.0, 1.0, 10.0, 15.0, 1.0 / 15.0, 0.0, 0.0, 0)
Exemple #3
0
 def time_compute_distance2line(self):
     for _ in range(1000000):
         montecarlo.compute_distance2line_wrapper(2.20866912e+15, -0.251699059004, 1.05581082105e+15, 1.06020910733e+15, 1693440.0, 5.90513983371e-07, 1.0602263591e+15, 1.06011723237e+15, 2)
         montecarlo.compute_distance2line_wrapper(2.23434667994e+15, -0.291130548401, 1.05581082105e+15, 1.06733618121e+15, 1693440.0, 5.90513983371e-07, 1.06738407486e+15, 1.06732933961e+15, 3)