Skip to content

Commit

Permalink
Fix config change not propagating through to decay energies (#2825)
Browse files Browse the repository at this point in the history
  • Loading branch information
gridley committed Jan 11, 2024
1 parent 63cb7c2 commit cc15f5e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openmc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import warnings

from openmc.data import DataLibrary
from openmc.data.decay import _DECAY_PHOTON_ENERGY
from openmc.data.decay import _DECAY_ENERGY, _DECAY_PHOTON_ENERGY

__all__ = ["config"]

Expand Down Expand Up @@ -41,6 +41,7 @@ def __setitem__(self, key, value):
os.environ['OPENMC_CHAIN_FILE'] = str(value)
# Reset photon source data since it relies on chain file
_DECAY_PHOTON_ENERGY.clear()
_DECAY_ENERGY.clear()
else:
raise KeyError(f'Unrecognized config key: {key}. Acceptable keys '
'are "cross_sections", "mg_cross_sections" and '
Expand Down Expand Up @@ -76,7 +77,7 @@ def _default_config():
if (chain_file is None and
config.get('cross_sections') is not None and
config['cross_sections'].exists()
):
):
# Check for depletion chain in cross_sections.xml
data = DataLibrary.from_xml(config['cross_sections'])
for lib in reversed(data.libraries):
Expand Down

0 comments on commit cc15f5e

Please sign in to comment.