From 9867a4340abbbd2fa093acb1fd04ed1745ab6513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Wed, 29 Jun 2022 14:19:56 +0200 Subject: [PATCH 1/2] [skip ci] use .num_mesh_cells Co-authored-by: Paul Romano --- tests/unit_tests/test_mesh_to_vtk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_mesh_to_vtk.py b/tests/unit_tests/test_mesh_to_vtk.py index e487b3668b..b57235edda 100644 --- a/tests/unit_tests/test_mesh_to_vtk.py +++ b/tests/unit_tests/test_mesh_to_vtk.py @@ -32,7 +32,7 @@ def test_write_data_to_vtk(mesh, tmpdir): # BUILD filename = tmpdir / "out.vtk" - data = np.random.random(mesh.dimension[0]*mesh.dimension[1]*mesh.dimension[2]) + data = np.random.random(mesh.num_mesh_cells) # RUN mesh.write_data_to_vtk(filename=filename, datasets={"label1": data, "label2": data}) From 7e074fe354fc60887c8c4d6540c28e1a6a338ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Wed, 29 Jun 2022 14:20:17 +0200 Subject: [PATCH 2/2] [skip ci] str(filename) Co-authored-by: Paul Romano --- openmc/mesh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 1372c5196e..e024710b48 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -699,7 +699,7 @@ class RegularMesh(StructuredMesh): # write the .vtk file writer = vtk.vtkStructuredGridWriter() - writer.SetFileName(filename) + writer.SetFileName(str(filename)) writer.SetInputData(vtk_grid) writer.Write()