Updates to object lifecycle for WeightWindows and WeightWindowGenerators (#2582)

This commit is contained in:
Patrick Shriwise 2023-06-30 22:29:47 -05:00 committed by GitHub
parent 36f229eb01
commit 382bcb2e8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 275 additions and 211 deletions

View file

@ -241,7 +241,21 @@ def test_roundtrip(run_in_tmpdir, model, wws):
assert(ww_out == ww_in)
def test_ww_attrs(run_in_tmpdir, model):
def test_ww_attrs_python(model):
mesh = openmc.RegularMesh.from_domain(model.geometry)
lower_bounds = np.ones(mesh.dimension)
# ensure that creation of weight window objects with default arg values
# is successful
wws = openmc.WeightWindows(mesh, lower_bounds, upper_bound_ratio=10.0)
assert wws.energy_bounds == None
wwg = openmc.WeightWindowGenerator(mesh)
assert wwg.energy_bounds == None
def test_ww_attrs_capi(run_in_tmpdir, model):
model.export_to_xml()
openmc.lib.init()