mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
changing RunTimeError to ValueError
This commit is contained in:
parent
922a5fcf5a
commit
a3a28d094a
2 changed files with 4 additions and 4 deletions
|
|
@ -216,7 +216,7 @@ class StructuredMesh(MeshBase):
|
|||
|
||||
Raises
|
||||
------
|
||||
RuntimeError
|
||||
ValueError
|
||||
When the size of a dataset doesn't match the number of mesh cells
|
||||
|
||||
Returns
|
||||
|
|
@ -236,10 +236,10 @@ class StructuredMesh(MeshBase):
|
|||
)
|
||||
if isinstance(dataset, np.ndarray):
|
||||
if not dataset.size == self.num_mesh_cells:
|
||||
raise RuntimeError(errmsg)
|
||||
raise ValueError(errmsg)
|
||||
else:
|
||||
if len(dataset) == self.num_mesh_cells:
|
||||
raise RuntimeError(errmsg)
|
||||
raise ValueError(errmsg)
|
||||
cv.check_type('label', label, str)
|
||||
|
||||
vtk_grid = vtk.vtkStructuredGrid()
|
||||
|
|
|
|||
|
|
@ -80,5 +80,5 @@ def test_write_data_to_vtk_size_mismatch(mesh):
|
|||
f"The size of the dataset 'label' \({len(data)}\) should be equal to "
|
||||
f"the number of mesh cells \({mesh.num_mesh_cells}\)"
|
||||
)
|
||||
with pytest.raises(RuntimeError, match=expected_error_msg):
|
||||
with pytest.raises(ValueError, match=expected_error_msg):
|
||||
mesh.write_data_to_vtk(filename="out.vtk", datasets={"label": data})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue