Update find_package calls in OpenMCConfig.cmake (#3572)

This commit is contained in:
Paul Romano 2025-09-23 10:06:29 -05:00 committed by GitHub
parent ca63da91b9
commit 8f36ff2b3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 30 additions and 9 deletions

View file

@ -1,9 +1,12 @@
get_filename_component(OpenMC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
find_package(fmt REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../fmt)
find_package(pugixml REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../pugixml)
find_package(xtl REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../xtl)
find_package(xtensor REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../xtensor)
# Compute the install prefix from this file's location
get_filename_component(_OPENMC_PREFIX "${OpenMC_CMAKE_DIR}/../../.." ABSOLUTE)
find_package(fmt CONFIG REQUIRED HINTS ${_OPENMC_PREFIX})
find_package(pugixml CONFIG REQUIRED HINTS ${_OPENMC_PREFIX})
find_package(xtl CONFIG REQUIRED HINTS ${_OPENMC_PREFIX})
find_package(xtensor CONFIG REQUIRED HINTS ${_OPENMC_PREFIX})
if(@OPENMC_USE_DAGMC@)
find_package(DAGMC REQUIRED HINTS @DAGMC_DIR@)
endif()

View file

@ -366,7 +366,7 @@ class ExternalSourceRates(ExternalRates):
rate : float
External source rate in units of mass per time. A positive or
negative value corresponds to a feed or removal rate, respectively.
units : {'g/s', 'g/min', 'g/h', 'g/d', 'g/a'}
rate_units : {'g/s', 'g/min', 'g/h', 'g/d', 'g/a'}
Units for values specified in the `rate` argument. 's' for seconds,
'min' for minutes, 'h' for hours, 'a' for Julian years.
timesteps : list of int, optional

View file

@ -256,7 +256,7 @@ for i, (lib, estimator, ext_geom, holes) in enumerate(product(*param_values)):
def test_unstructured_mesh_tets(model, test_opts):
# skip the test if the library is not enabled
if test_opts['library'] == 'moab' and not openmc.lib._dagmc_enabled():
pytest.skip("DAGMC (and MOAB) mesh not enbaled in this build.")
pytest.skip("DAGMC (and MOAB) mesh not enabled in this build.")
if test_opts['library'] == 'libmesh' and not openmc.lib._libmesh_enabled():
pytest.skip("LibMesh is not enabled in this build.")

View file

@ -64,5 +64,8 @@ def test_plotting_geometry_filled_with_dagmc_universe(request):
cell2 = openmc.Cell(fill=csg_material, region=+sphere1 & -sphere2)
geometry = openmc.Geometry([cell1, cell2])
geometry.plot()
# Close plot to avoid warning
import matplotlib.pyplot as plt
plt.close()

View file

@ -654,6 +654,10 @@ def test_model_plot():
test_mask = (image_data == white) | (image_data == red)
assert np.all(test_mask), "Colors other than white or red found in overlap plot image"
# Close plots to avoid warning
import matplotlib.pyplot as plt
plt.close('all')
def test_model_id_map_initialization(run_in_tmpdir):
model = openmc.examples.pwr_assembly()

View file

@ -248,6 +248,10 @@ def test_plot():
c_before = openmc.Cell()
region.plot()
# Close plot to avoid warning
import matplotlib.pyplot as plt
plt.close()
# Ensure that calling plot doesn't affect cell ID space
c_after = openmc.Cell()
assert c_after.id - 1 == c_before.id

View file

@ -99,6 +99,10 @@ def test_plot(run_in_tmpdir, sphere_model):
pixels=100,
)
# Close plots to avoid warning
import matplotlib.pyplot as plt
plt.close('all')
def test_get_nuclides(uo2):
c = openmc.Cell(fill=uo2)

View file

@ -140,4 +140,4 @@ def test_wwinp_reader_failures(wwinp_data, request):
filename, expected_failure = wwinp_data
with pytest.raises(expected_failure):
_ = openmc.wwinp_to_wws(request.node.path.parent / filename)
_ = openmc.WeightWindowsList.from_wwinp(request.node.path.parent / filename)

View file

@ -15,4 +15,7 @@ if [[ $EVENT == 'y' ]]; then
fi
# Run unit tests and then regression tests
pytest --cov=openmc -v $args tests/unit_tests tests/regression_tests
pytest --cov=openmc -v $args \
tests/test_matplotlib_import.py \
tests/unit_tests \
tests/regression_tests