Skip to content

Commit

Permalink
pybamm-team#2188 changelog and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rtimms authored and js1tr3 committed Aug 12, 2024
1 parent 3e1389a commit c20cb24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def test_symbol_new_copy(self):
pybamm.maximum(a, b),
pybamm.SparseStack(mat, mat),
pybamm.Equality(a, b),
pybamm.EvaluateAt(a, 0),
]:
self.assertEqual(symbol, symbol.new_copy())

Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_expression_tree/test_operations/test_jac.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ def test_index(self):
jac = ind.jac(vec).evaluate(y=np.linspace(0, 2, 5)).toarray()
np.testing.assert_array_equal(jac, np.array([[0, 0, 0, 0, 0]]))

def test_evluate_at(self):
y = pybamm.StateVector(slice(0, 4))
expr = pybamm.EvaluateAt(y, 2)
jac = expr.jac(y).evaluate(y=np.linspace(0, 2, 4))
np.testing.assert_array_equal(jac, 0)

def test_jac_of_number(self):
"""Jacobian of a number should be zero"""
a = pybamm.Scalar(1)
Expand Down

0 comments on commit c20cb24

Please sign in to comment.