Skip to content

Commit 8f36ff2

Browse files
authored
Update find_package calls in OpenMCConfig.cmake (#3572)
1 parent ca63da9 commit 8f36ff2

9 files changed

Lines changed: 30 additions & 9 deletions

File tree

cmake/OpenMCConfig.cmake.in

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
get_filename_component(OpenMC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
22

3-
find_package(fmt REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../fmt)
4-
find_package(pugixml REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../pugixml)
5-
find_package(xtl REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../xtl)
6-
find_package(xtensor REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../xtensor)
3+
# Compute the install prefix from this file's location
4+
get_filename_component(_OPENMC_PREFIX "${OpenMC_CMAKE_DIR}/../../.." ABSOLUTE)
5+
6+
find_package(fmt CONFIG REQUIRED HINTS ${_OPENMC_PREFIX})
7+
find_package(pugixml CONFIG REQUIRED HINTS ${_OPENMC_PREFIX})
8+
find_package(xtl CONFIG REQUIRED HINTS ${_OPENMC_PREFIX})
9+
find_package(xtensor CONFIG REQUIRED HINTS ${_OPENMC_PREFIX})
710
if(@OPENMC_USE_DAGMC@)
811
find_package(DAGMC REQUIRED HINTS @DAGMC_DIR@)
912
endif()

openmc/deplete/transfer_rates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def set_external_source_rate(
366366
rate : float
367367
External source rate in units of mass per time. A positive or
368368
negative value corresponds to a feed or removal rate, respectively.
369-
units : {'g/s', 'g/min', 'g/h', 'g/d', 'g/a'}
369+
rate_units : {'g/s', 'g/min', 'g/h', 'g/d', 'g/a'}
370370
Units for values specified in the `rate` argument. 's' for seconds,
371371
'min' for minutes, 'h' for hours, 'a' for Julian years.
372372
timesteps : list of int, optional

tests/regression_tests/unstructured_mesh/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def model():
256256
def test_unstructured_mesh_tets(model, test_opts):
257257
# skip the test if the library is not enabled
258258
if test_opts['library'] == 'moab' and not openmc.lib._dagmc_enabled():
259-
pytest.skip("DAGMC (and MOAB) mesh not enbaled in this build.")
259+
pytest.skip("DAGMC (and MOAB) mesh not enabled in this build.")
260260

261261
if test_opts['library'] == 'libmesh' and not openmc.lib._libmesh_enabled():
262262
pytest.skip("LibMesh is not enabled in this build.")

tests/unit_tests/dagmc/test_plot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,8 @@ def test_plotting_geometry_filled_with_dagmc_universe(request):
6464
cell2 = openmc.Cell(fill=csg_material, region=+sphere1 & -sphere2)
6565

6666
geometry = openmc.Geometry([cell1, cell2])
67-
6867
geometry.plot()
68+
69+
# Close plot to avoid warning
70+
import matplotlib.pyplot as plt
71+
plt.close()

tests/unit_tests/test_model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,10 @@ def test_model_plot():
654654
test_mask = (image_data == white) | (image_data == red)
655655
assert np.all(test_mask), "Colors other than white or red found in overlap plot image"
656656

657+
# Close plots to avoid warning
658+
import matplotlib.pyplot as plt
659+
plt.close('all')
660+
657661

658662
def test_model_id_map_initialization(run_in_tmpdir):
659663
model = openmc.examples.pwr_assembly()

tests/unit_tests/test_region.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ def test_plot():
248248
c_before = openmc.Cell()
249249
region.plot()
250250

251+
# Close plot to avoid warning
252+
import matplotlib.pyplot as plt
253+
plt.close()
254+
251255
# Ensure that calling plot doesn't affect cell ID space
252256
c_after = openmc.Cell()
253257
assert c_after.id - 1 == c_before.id

tests/unit_tests/test_universe.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ def test_plot(run_in_tmpdir, sphere_model):
9999
pixels=100,
100100
)
101101

102+
# Close plots to avoid warning
103+
import matplotlib.pyplot as plt
104+
plt.close('all')
105+
102106

103107
def test_get_nuclides(uo2):
104108
c = openmc.Cell(fill=uo2)

tests/unit_tests/weightwindows/test_wwinp_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ def test_wwinp_reader_failures(wwinp_data, request):
140140
filename, expected_failure = wwinp_data
141141

142142
with pytest.raises(expected_failure):
143-
_ = openmc.wwinp_to_wws(request.node.path.parent / filename)
143+
_ = openmc.WeightWindowsList.from_wwinp(request.node.path.parent / filename)

tools/ci/gha-script.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ if [[ $EVENT == 'y' ]]; then
1515
fi
1616

1717
# Run unit tests and then regression tests
18-
pytest --cov=openmc -v $args tests/unit_tests tests/regression_tests
18+
pytest --cov=openmc -v $args \
19+
tests/test_matplotlib_import.py \
20+
tests/unit_tests \
21+
tests/regression_tests

0 commit comments

Comments
 (0)