From 52fcd635a5ba88563464a7a3848ec38809333ef6 Mon Sep 17 00:00:00 2001 From: cmp0xff Date: Sun, 1 Sep 2024 23:42:21 +0200 Subject: [PATCH] chore(test): #83 more strict test --- tests/models/kepler_problem/test_dynamics.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/models/kepler_problem/test_dynamics.py b/tests/models/kepler_problem/test_dynamics.py index 0c08e22..45e4a7b 100644 --- a/tests/models/kepler_problem/test_dynamics.py +++ b/tests/models/kepler_problem/test_dynamics.py @@ -13,11 +13,11 @@ from hamilflow.models.kepler_problem.dynamics import ( _tau_of_1_plus_u_hyperbolic, - _tau_of_e_minus_u_elliptic, _tau_of_e_minus_u_hyperbolic, - _tau_of_e_plus_u_elliptic, - _tau_of_u_exact_elliptic, _tau_of_u_exact_hyperbolic, + tau_of_e_minus_u_elliptic, + tau_of_e_plus_u_elliptic, + tau_of_u_exact_elliptic, tau_of_u_prime, ) @@ -70,7 +70,7 @@ def integrand(u: "npt.ArrayLike") -> "npt.ArrayLike": def exact_and_approx_tau_s( self, ecc: float, - ) -> "tuple[Callable[[float, npt.NDArray[np.float64]], npt.NDArray[np.float64]], Callable[[float, npt.NDArray[np.float64]], npt.NDArray[np.float64]], Callable[[float, npt.NDArray[np.float64]], npt.NDArray[np.float64]]]": + ) -> """tuple[Callable[[float, npt.NDArray[np.float64]], npt.NDArray[np.float64]], Callable[[float, npt.NDArray[np.float64]], npt.NDArray[np.float64]], Callable[[float, npt.NDArray[np.float64]], npt.NDArray[np.float64]]]""": """Give approximate and exact solutions for the elliptic and hyperbolic cases. The exact solutions have removable singularities at the boundary of domain, @@ -81,9 +81,9 @@ def exact_and_approx_tau_s( pytest.skip(f"{c} case is exact") elif 0 < ecc < 1: return ( - _tau_of_u_exact_elliptic, - _tau_of_e_plus_u_elliptic, - _tau_of_e_minus_u_elliptic, + tau_of_u_exact_elliptic, + tau_of_e_plus_u_elliptic, + tau_of_e_minus_u_elliptic, ) elif ecc > 1: return ( @@ -94,7 +94,7 @@ def exact_and_approx_tau_s( else: raise ValueError(f"Expect ecc >= 0, got {ecc}") - @pytest.mark.parametrize("epsilon", [1e-7]) + @pytest.mark.parametrize("epsilon", [3e-7]) def test_expansion( self, ecc: float,