Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Nov 9, 2022
1 parent 96e1cb2 commit c2c0f28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions pybamm/expression_tree/concatenations.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ def simplified_concatenation(*children):
def concatenation(*children):
"""Helper function to create concatenations."""
# TODO: add option to turn off simplifications
if len(children) == 3 and children[-1].domain == ["current collector"]:
print("here")
return simplified_concatenation(*children)


Expand Down
3 changes: 0 additions & 3 deletions pybamm/meshes/meshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ def combine_submeshes(self, *submeshnames):
"""
if submeshnames == ():
raise ValueError("Submesh domains being combined cannot be empty")
# If there is just a single submesh, we can return it directly
if len(submeshnames) == 1:
return self[submeshnames[0]]
# Check that the final edge of each submesh is the same as the first edge of the
# next submesh
for i in range(len(submeshnames) - 1):
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/test_expression_tree/test_unary_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,14 @@ def test_to_equation(self):
sympy.Integral("d", sympy.Symbol("xn")),
)

def test_explicit_time_integral(self):
expr = pybamm.ExplicitTimeIntegral(pybamm.Parameter("param"), pybamm.Scalar(1))
self.assertEqual(expr.child, pybamm.Parameter("param"))
self.assertEqual(expr.initial_condition, pybamm.Scalar(1))
self.assertEqual(expr.name, "explicit time integral")
self.assertEqual(expr.new_copy(), expr)
self.assertFalse(expr.is_constant())


if __name__ == "__main__":
print("Add -v for more debug output")
Expand Down

0 comments on commit c2c0f28

Please sign in to comment.