From 33090becedd343f3b7967bfe52bcc0c2d83909b9 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 02:50:01 -0500 Subject: [PATCH 1/9] test: use canonical unstructured mesh assets --- tests/unit_tests/test_mesh.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_mesh.py b/tests/unit_tests/test_mesh.py index c6ebd687f7e..83c13781253 100644 --- a/tests/unit_tests/test_mesh.py +++ b/tests/unit_tests/test_mesh.py @@ -14,6 +14,8 @@ from uncertainties.unumpy import uarray, nominal_values, std_devs +UMESH_DIR = Path(__file__).resolve().parents[1] / 'regression_tests' / 'unstructured_mesh' + @pytest.mark.parametrize("val_left,val_right", [(0, 0), (-1., -1.), (2.0, 2)]) def test_raises_error_when_flat(val_left, val_right): """Checks that an error is raised when a mesh is flat""" @@ -388,7 +390,7 @@ def test_mesh_name_roundtrip(run_in_tmpdir): def test_umesh_roundtrip(run_in_tmpdir, request): - umesh = openmc.UnstructuredMesh(request.path.parent / 'test_mesh_tets.e', 'moab') + umesh = openmc.UnstructuredMesh(UMESH_DIR / 'test_mesh_tets.exo', 'moab') umesh.interface = 'xdg' umesh.output = True @@ -566,7 +568,7 @@ def test_umesh(run_in_tmpdir, simple_umesh, export_type): "moab" ), ( - Path("test_mesh_hexes.exo"), + UMESH_DIR / "test_mesh_hexes.exo", "libmesh" ) ] From 9f073c3fed2ae370a052d5f35889ef48c6136c03 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 02:50:03 -0500 Subject: [PATCH 2/9] test: use canonical tetrahedral mesh source --- tests/unit_tests/test_source_mesh.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/unit_tests/test_source_mesh.py b/tests/unit_tests/test_source_mesh.py index 78211493a55..398e74325f4 100644 --- a/tests/unit_tests/test_source_mesh.py +++ b/tests/unit_tests/test_source_mesh.py @@ -15,6 +15,8 @@ # MeshSpatial Tests ################### TETS_PER_VOXEL = 12 +UMESH_TETS = (Path(__file__).resolve().parents[1] / 'regression_tests' / + 'unstructured_mesh' / 'test_mesh_tets.exo') # This test uses a geometry file with cells that match a regular mesh. Each cell # in the geometry corresponds to 12 tetrahedra in the unstructured mesh file. @@ -83,7 +85,7 @@ def test_unstructured_mesh_sampling(model, request, test_cases): pytest.skip("XDG mesh interface not enabled in this build.") # setup mesh source ### - mesh_filename = Path(request.fspath).parent / "test_mesh_tets.e" + mesh_filename = UMESH_TETS uscd_mesh = openmc.UnstructuredMesh(mesh_filename, test_cases['library']) uscd_mesh.interface = test_cases['interface'] @@ -153,7 +155,7 @@ def test_unstructured_mesh_sampling(model, request, test_cases): def test_strengths_size_failure(request, model): # setup mesh source ### - mesh_filename = Path(request.fspath).parent / "test_mesh_tets.e" + mesh_filename = UMESH_TETS uscd_mesh = openmc.UnstructuredMesh(mesh_filename, 'libmesh') # intentionally incorrectly sized to trigger an error @@ -191,7 +193,7 @@ def test_roundtrip(run_in_tmpdir, model, request): ): pytest.skip("Unstructured mesh is not enabled in this build.") - mesh_filename = Path(request.fspath).parent / 'test_mesh_tets.e' + mesh_filename = UMESH_TETS ucd_mesh = openmc.UnstructuredMesh(mesh_filename, library='libmesh') if not openmc.lib.feature_enabled('libmesh'): @@ -339,7 +341,7 @@ def test_umesh_source_independent(run_in_tmpdir, request, void_model, library, i model = void_model - mesh_filename = Path(request.fspath).parent / "test_mesh_tets.e" + mesh_filename = UMESH_TETS uscd_mesh = openmc.UnstructuredMesh(mesh_filename, library) uscd_mesh.interface = interface ind_source = openmc.IndependentSource() From dae0d0ed301b254887344bc2ecdaf400b538332e Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 02:50:05 -0500 Subject: [PATCH 3/9] test: reuse canonical mesh in weight-window test --- tests/unit_tests/weightwindows/test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit_tests/weightwindows/test.py b/tests/unit_tests/weightwindows/test.py index fa8ca095fd3..3b1d45f9d89 100644 --- a/tests/unit_tests/weightwindows/test.py +++ b/tests/unit_tests/weightwindows/test.py @@ -14,6 +14,9 @@ from tests import cdtemp +UMESH_TETS = (Path(__file__).resolve().parents[2] / 'regression_tests' / + 'unstructured_mesh' / 'test_mesh_tets.exo') + @pytest.fixture def wws(): @@ -372,7 +375,7 @@ def test_unstructured_mesh_applied_wws(request, run_in_tmpdir, library, interfac cell = openmc.Cell(region=-box, fill=water) geometry = openmc.Geometry([cell]) - mesh_file = str(request.fspath.dirpath() / 'test_mesh_tets.exo') + mesh_file = str(UMESH_TETS) mesh = openmc.UnstructuredMesh(mesh_file, library) mesh.interface = interface From 73571cac3690a7e6d0e0f06a921e523c7f4f8017 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 02:50:08 -0500 Subject: [PATCH 4/9] test: reuse canonical mesh in weight-window list test --- tests/unit_tests/weightwindows/test_ww_list.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/unit_tests/weightwindows/test_ww_list.py b/tests/unit_tests/weightwindows/test_ww_list.py index c6c82ebd17d..4198535fd13 100644 --- a/tests/unit_tests/weightwindows/test_ww_list.py +++ b/tests/unit_tests/weightwindows/test_ww_list.py @@ -1,3 +1,5 @@ +from pathlib import Path + import h5py import numpy as np import pytest @@ -6,6 +8,9 @@ import openmc.lib +UMESH_TETS = (Path(__file__).resolve().parents[2] / 'regression_tests' / + 'unstructured_mesh' / 'test_mesh_tets.exo') + def test_ww_roundtrip(request, run_in_tmpdir, monkeypatch): # Load weight windows from a wwinp file wwinp_file = request.path.with_name('wwinp_n') @@ -87,7 +92,7 @@ def test_export_hdf5_unstructured_mesh(request, run_in_tmpdir, library): pytest.skip('DAGMC (and MOAB) not enabled in this build.') mesh = openmc.UnstructuredMesh( - request.path.with_name('test_mesh_tets.exo'), library, mesh_id=20, + UMESH_TETS, library, mesh_id=20, name='unstructured', length_multiplier=2.0) ww = openmc.WeightWindows(mesh, np.ones(12_000), upper_bound_ratio=5.0) openmc.WeightWindowsList([ww]).export_to_hdf5('ww.h5') From 2abd6c14fb13a9e6263f801f2ebbbcd91c5ad728 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 02:50:36 -0500 Subject: [PATCH 5/9] test: remove duplicate test_mesh_tets.e mesh asset --- tests/unit_tests/test_mesh_tets.e | 1 - 1 file changed, 1 deletion(-) delete mode 120000 tests/unit_tests/test_mesh_tets.e diff --git a/tests/unit_tests/test_mesh_tets.e b/tests/unit_tests/test_mesh_tets.e deleted file mode 120000 index 8a6287b4de2..00000000000 --- a/tests/unit_tests/test_mesh_tets.e +++ /dev/null @@ -1 +0,0 @@ -../regression_tests/unstructured_mesh/test_mesh_tets.e \ No newline at end of file From 43ef0d83cbcde43dd1a0019a951084a01442cf1d Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 02:50:37 -0500 Subject: [PATCH 6/9] test: remove duplicate test_mesh_hexes.exo mesh asset --- tests/unit_tests/test_mesh_hexes.exo | 1 - 1 file changed, 1 deletion(-) delete mode 120000 tests/unit_tests/test_mesh_hexes.exo diff --git a/tests/unit_tests/test_mesh_hexes.exo b/tests/unit_tests/test_mesh_hexes.exo deleted file mode 120000 index 272da92a4ad..00000000000 --- a/tests/unit_tests/test_mesh_hexes.exo +++ /dev/null @@ -1 +0,0 @@ -../regression_tests/unstructured_mesh/test_mesh_hexes.exo \ No newline at end of file From 56f2787d7666c2f2b9e557e629b3ae8267dd1460 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 02:50:39 -0500 Subject: [PATCH 7/9] test: remove duplicate test_mesh_tets.exo mesh asset --- tests/unit_tests/weightwindows/test_mesh_tets.exo | 1 - 1 file changed, 1 deletion(-) delete mode 120000 tests/unit_tests/weightwindows/test_mesh_tets.exo diff --git a/tests/unit_tests/weightwindows/test_mesh_tets.exo b/tests/unit_tests/weightwindows/test_mesh_tets.exo deleted file mode 120000 index 5bf23b369a3..00000000000 --- a/tests/unit_tests/weightwindows/test_mesh_tets.exo +++ /dev/null @@ -1 +0,0 @@ -../../regression_tests/unstructured_mesh/test_mesh_tets.e \ No newline at end of file From 10f59accb1c8fd83211065d5409bce4a1cea3f6c Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:31:28 -0500 Subject: [PATCH 8/9] test: reuse canonical DAGMC VTK mesh asset --- tests/unit_tests/test_mesh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_mesh.py b/tests/unit_tests/test_mesh.py index 83c13781253..861937e0c12 100644 --- a/tests/unit_tests/test_mesh.py +++ b/tests/unit_tests/test_mesh.py @@ -564,7 +564,7 @@ def test_umesh(run_in_tmpdir, simple_umesh, export_type): vtkhdf_tests = [ ( - Path("test_mesh_dagmc_tets.vtk"), + UMESH_DIR / "test_mesh_dagmc_tets.vtk", "moab" ), ( From 377be83af29831c0f74035deedcc57cfd6f43a38 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:31:31 -0500 Subject: [PATCH 9/9] test: remove duplicate DAGMC VTK mesh asset --- tests/unit_tests/test_mesh_dagmc_tets.vtk | 1 - 1 file changed, 1 deletion(-) delete mode 120000 tests/unit_tests/test_mesh_dagmc_tets.vtk diff --git a/tests/unit_tests/test_mesh_dagmc_tets.vtk b/tests/unit_tests/test_mesh_dagmc_tets.vtk deleted file mode 120000 index 9f7000175d7..00000000000 --- a/tests/unit_tests/test_mesh_dagmc_tets.vtk +++ /dev/null @@ -1 +0,0 @@ -../regression_tests/unstructured_mesh/test_mesh_dagmc_tets.vtk \ No newline at end of file