Skip to content

Commit

Permalink
begin working on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bills committed Dec 12, 2024
1 parent d468be4 commit 1c82b6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pybamm/parameters/parameter_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,12 @@ def process_geometry(self, geometry):

def process_and_check(sym):
new_sym = self.process_symbol(sym)
if not isinstance(new_sym, pybamm.Scalar) and not isinstance(
new_sym, pybamm.InputParameter
):
raise ValueError(
"Geometry parameters must be Scalars or InputParameters after parameter processing"
)
#if not isinstance(new_sym, pybamm.Scalar) and not isinstance(
# new_sym, pybamm.InputParameter
#):
# raise ValueError(
# "Geometry parameters must be Scalars or InputParameters after parameter processing"
# )
return new_sym

for domain in geometry:
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/test_meshes/test_one_dimensional_submesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def test_exceptions(self):
lims = {"a": 1, "b": 2}
with pytest.raises(pybamm.GeometryError):
pybamm.SymbolicUniform1DSubMesh(lims, None)
tabs = {"negative": {"z_centre": 0}, "positive": {"z_centre": 1}}

with pytest.raises(NotImplementedError):
pybamm.SymbolicUniform1DSubMesh(lims, 20, tabs=tabs)

Check failure on line 100 in tests/unit/test_meshes/test_one_dimensional_submesh.py

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest / Python 3.12)

TestSymbolicUniform1DSubMesh.test_exceptions pybamm.expression_tree.exceptions.GeometryError: lims should only contain a single variable

def test_symmetric_mesh_creation_no_parameters(self, r, geometry):
submesh_types = {"negative particle": pybamm.Uniform1DSubMesh}
Expand Down

0 comments on commit 1c82b6c

Please sign in to comment.