Skip to content

Commit f2f0cbd

Browse files
committed
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.
1 parent 3d7cea1 commit f2f0cbd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test/rmgpy/kinetics/kineticsSurfaceTest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,9 +741,11 @@ def test_get_rate_coefficient(self):
741741
Ea = Ea_ox - (alpha_ox * electrons_ox * constants.F * (V-V0_ox))
742742
k_oxidation = A_ox * (T / T0_ox) ** n_ox * np.exp(-Ea / (constants.R * T))
743743
Ea = Ea_red - (alpha_red * electrons_red * constants.F * (V-V0_red))
744-
k_reduction = A_red * (T / T0_red) ** n_red * np.exp(-Ea / (constants.R * T))
745-
assert round(abs(k_oxidation-self.surfchargerxn_oxidation.get_rate_coefficient(T,V)), 7) == 0
746-
assert round(abs(k_reduction-self.surfchargerxn_reduction.get_rate_coefficient(T,V)), 7) == 0
744+
k_reduction = A_red * (T / T0_red) ** n_red * np.exp(-Ea / (constants.R * T))
745+
kox = self.surfchargerxn_oxidation.get_rate_coefficient(T,V)
746+
kred = self.surfchargerxn_reduction.get_rate_coefficient(T,V)
747+
assert abs(k_oxidation - kox) < 1e-6 * kox
748+
assert abs(k_reduction - kred) < 1e-6 * kred
747749

748750
def test_change_v0(self):
749751

0 commit comments

Comments
 (0)