Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/openmc/weight_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct WeightWindow {
{
lower_weight *= factor;
upper_weight *= factor;
survival_weight *= factor;
}
};

Expand Down
4 changes: 2 additions & 2 deletions tests/regression_tests/weightwindows/generators/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def test_ww_generator(run_in_tmpdir):
# just test that the generation happens successfully here
assert os.path.exists('weight_windows.h5')

wws_mean = openmc.hdf5_to_wws()
wws_mean = openmc.WeightWindowsList.from_hdf5()
assert len(wws_mean) == 1

# check that generation using the relative error works too
wwg.update_parameters['value'] = 'rel_err'
model.run()

wws_rel_err = openmc.hdf5_to_wws()
wws_rel_err = openmc.WeightWindowsList.from_hdf5()
assert len(wws_rel_err) == 1

# we should not get the same set of weight windows when switching to use of
Expand Down
2 changes: 1 addition & 1 deletion tests/regression_tests/weightwindows/results_true.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a5880ad9262e8aba90801783891ee74618144101401f06fb46e954e851a3c517ab28d5f0d6e1b2b364844f08d363cba35ab23b63fc81012ea8a6a328755d56c4
5df0c08573ccee3fd3495c877c7dc0c4b69c245faf8473b848c89fb837dea7fd437936ffebeb6455c793e66046c46eb0ad6941cc5ef1699fc5fc8a7fcb9b5a0c
6 changes: 3 additions & 3 deletions tests/regression_tests/weightwindows/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from copy import deepcopy
import pytest
import numpy as np

Expand All @@ -8,6 +7,7 @@
from tests.testing_harness import HashedPyAPITestHarness



@pytest.fixture
def model():
model = openmc.Model()
Expand Down Expand Up @@ -114,7 +114,7 @@ def test_weightwindows(model):

def test_wwinp_cylindrical():

ww = openmc.wwinp_to_wws('ww_n_cyl.txt')[0]
ww = openmc.WeightWindowsList.from_wwinp('ww_n_cyl.txt')[0]

mesh = ww.mesh

Expand Down Expand Up @@ -144,7 +144,7 @@ def test_wwinp_cylindrical():

def test_wwinp_spherical():

ww = openmc.wwinp_to_wws('ww_n_sph.txt')[0]
ww = openmc.WeightWindowsList.from_wwinp('ww_n_sph.txt')[0]

mesh = ww.mesh

Expand Down
2 changes: 1 addition & 1 deletion tests/testing_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def _compare_results(self):
class WeightWindowPyAPITestHarness(PyAPITestHarness):
def _get_results(self):
"""Digest info in the weight window file and return as a string."""
ww = openmc.hdf5_to_wws()[0]
ww = openmc.WeightWindowsList.from_hdf5()[0]

# Access the weight window bounds
lower_bound = ww.lower_ww_bounds
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/weightwindows/test_ww_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def test_python_hdf5_roundtrip(run_in_tmpdir, model):

openmc.lib.finalize()

wws_hdf5 = openmc.hdf5_to_wws()[0]
wws_hdf5 = openmc.WeightWindowsList.from_hdf5()[0]

# ensure
assert all(wws.energy_bounds == wws_hdf5.energy_bounds)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/weightwindows/test_wwinp_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def id_fn(params):
def test_wwinp_reader(wwinp_data, request):
wwinp_file, mesh, particle_types, energy_bounds = wwinp_data

wws = openmc.wwinp_to_wws(request.node.path.parent / wwinp_file)
wws = openmc.WeightWindowsList.from_wwinp(request.node.path.parent / wwinp_file)

for i, ww in enumerate(wws):
e_bounds = energy_bounds[i]
Expand Down