Skip to content

Commit

Permalink
Merge branch 'implementing-pytest-rule' of https://github.com/prady0t…
Browse files Browse the repository at this point in the history
…/PyBaMM into implementing-pytest-rule

Merge
  • Loading branch information
prady0t committed Sep 29, 2024
2 parents 1628017 + 95a8405 commit b11754a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,3 @@ def test_compare_narrow_size_distribution(self):
# compare outputs
comparison = StandardOutputComparison(solutions)
comparison.test_all(skip_first_timestep=True)


Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,12 @@ def j_p(delta_phi):
j_n_FD = parameter_values.process_symbol(
(j_n(delta_phi + h) - j_n(delta_phi - h)) / (2 * h)
)
assert j_n_diff.evaluate(inputs={"delta_phi": 0.5}) \
/ j_n_FD.evaluate(inputs={"delta_phi": 0.5}) == pytest.approx(
1,
abs=1e-05)
assert j_n_diff.evaluate(inputs={"delta_phi": 0.5}) / j_n_FD.evaluate(
inputs={"delta_phi": 0.5}
) == pytest.approx(1, abs=1e-05)
j_p_FD = parameter_values.process_symbol(
(j_p(delta_phi + h) - j_p(delta_phi - h)) / (2 * h)
)
assert j_p_diff.evaluate(inputs={"delta_phi": 0.5}) \
/ j_p_FD.evaluate(inputs={"delta_phi": 0.5}) == pytest.approx(
1,
abs=1e-05)


assert j_p_diff.evaluate(inputs={"delta_phi": 0.5}) / j_p_FD.evaluate(
inputs={"delta_phi": 0.5}
) == pytest.approx(1, abs=1e-05)
Original file line number Diff line number Diff line change
Expand Up @@ -745,4 +745,3 @@ def test_jax_coo_matrix(self):

with pytest.raises(NotImplementedError):
A.multiply(v)

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ def test_functions(self):
}

for name, value in fun_test.items():
assert param.evaluate(param[name](*value[0])) == pytest.approx(value[1], abs=0.0001)


assert param.evaluate(param[name](*value[0])) == pytest.approx(
value[1], abs=0.0001
)

0 comments on commit b11754a

Please sign in to comment.