From f3fca44bc7f38c02ec72b6627f1dd91071b17583 Mon Sep 17 00:00:00 2001 From: ssun30 Date: Wed, 25 Sep 2024 14:30:53 -0400 Subject: [PATCH] Changed rate coefficient test to use rtol kineticsSurfaceTest used atol for rate coefficient tests previously. The atol was too strict for double precision floating point. All other rate coefficient tests used rtol. --- test/rmgpy/kinetics/kineticsSurfaceTest.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/rmgpy/kinetics/kineticsSurfaceTest.py b/test/rmgpy/kinetics/kineticsSurfaceTest.py index d159b27382..5aeaf0b746 100644 --- a/test/rmgpy/kinetics/kineticsSurfaceTest.py +++ b/test/rmgpy/kinetics/kineticsSurfaceTest.py @@ -741,9 +741,11 @@ def test_get_rate_coefficient(self): Ea = Ea_ox - (alpha_ox * electrons_ox * constants.F * (V-V0_ox)) k_oxidation = A_ox * (T / T0_ox) ** n_ox * np.exp(-Ea / (constants.R * T)) Ea = Ea_red - (alpha_red * electrons_red * constants.F * (V-V0_red)) - k_reduction = A_red * (T / T0_red) ** n_red * np.exp(-Ea / (constants.R * T)) - assert round(abs(k_oxidation-self.surfchargerxn_oxidation.get_rate_coefficient(T,V)), 7) == 0 - assert round(abs(k_reduction-self.surfchargerxn_reduction.get_rate_coefficient(T,V)), 7) == 0 + k_reduction = A_red * (T / T0_red) ** n_red * np.exp(-Ea / (constants.R * T)) + kox = self.surfchargerxn_oxidation.get_rate_coefficient(T,V) + kred = self.surfchargerxn_reduction.get_rate_coefficient(T,V) + assert abs(k_oxidation - kox) < 1e-6 * kox + assert abs(k_reduction - kred) < 1e-6 * kred def test_change_v0(self):