mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Merge pull request #2283 from paulromano/chain-reduce-sources-bugfix
Make sure Chain.reduce preserves decay source information
This commit is contained in:
commit
b9c1eb34fb
2 changed files with 3 additions and 0 deletions
|
|
@ -1025,6 +1025,7 @@ class Chain:
|
|||
new_nuclide = Nuclide(previous.name)
|
||||
new_nuclide.half_life = previous.half_life
|
||||
new_nuclide.decay_energy = previous.decay_energy
|
||||
new_nuclide.sources = previous.sources.copy()
|
||||
if hasattr(previous, '_fpy'):
|
||||
new_nuclide._fpy = previous._fpy
|
||||
|
||||
|
|
|
|||
|
|
@ -500,6 +500,7 @@ def test_reduce(gnd_simple_chain, endf_chain):
|
|||
assert u5_round0.n_decay_modes == ref_U5.n_decay_modes
|
||||
assert u5_round0.half_life == ref_U5.half_life
|
||||
assert u5_round0.decay_energy == ref_U5.decay_energy
|
||||
assert u5_round0.sources == ref_U5.sources
|
||||
for newmode, refmode in zip(u5_round0.decay_modes, ref_U5.decay_modes):
|
||||
assert newmode.target is None
|
||||
assert newmode.type == refmode.type
|
||||
|
|
@ -522,6 +523,7 @@ def test_reduce(gnd_simple_chain, endf_chain):
|
|||
assert bareI5.n_decay_modes == ref_iodine.n_decay_modes
|
||||
assert bareI5.half_life == ref_iodine.half_life
|
||||
assert bareI5.decay_energy == ref_iodine.decay_energy
|
||||
assert bareI5.sources == ref_iodine.sources
|
||||
for newmode, refmode in zip(bareI5.decay_modes, ref_iodine.decay_modes):
|
||||
assert newmode.target is None
|
||||
assert newmode.type == refmode.type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue