Skip to content
Open
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
4 changes: 2 additions & 2 deletions openmc/deplete/d1s.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def prepare_tallies(
for f in tally.filters:
if isinstance(f, openmc.ParticleFilter):
if list(f.bins) == ['photon']:
tally.filters.append(filter)
if not tally.contains_filter(openmc.ParentNuclideFilter):
tally.filters.append(filter)
break

return nuclides
5 changes: 5 additions & 0 deletions tests/unit_tests/test_d1s.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def test_prepare_tallies(model):
assert tally.contains_filter(openmc.ParentNuclideFilter)
assert sorted(tally.filters[-1].bins) == sorted(radionuclides)

assert len(tally.filters) == 2
# calling prepare_tallies twice should not add another ParentNuclideFilter
d1s.prepare_tallies(model, chain_file=CHAIN_PATH)
assert len(tally.filters) == 2


def test_apply_time_correction(run_in_tmpdir):
# Make simple sphere model with elemental Ni
Expand Down