rename varible as suggested in review

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Jonathan Shimwell 2020-10-19 13:33:02 +01:00 committed by GitHub
parent acde663c90
commit 975fb850d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -64,7 +64,8 @@ REACTION_NAME.update({i: '(n,3He{})'.format(i - 750) for i in range(750, 799)})
REACTION_NAME.update({i: '(n,a{})'.format(i - 800) for i in range(800, 849)})
REACTION_NAME.update({i: '(n,2n{})'.format(i - 875) for i in range(875, 891)})
REACTION_NUMBER = dict(zip(REACTION_NAME.values(), REACTION_NAME.keys()))
REACTION_MT = {name: mt for mt, name in REACTION_NAME.items()}
REACTION_MT['fission'] = 18
FISSION_MTS = (18, 19, 20, 21, 38)

View file

@ -11,7 +11,7 @@ from numpy import dot, zeros, newaxis, asarray
from . import comm
from openmc.checkvalue import check_type, check_greater_than
from openmc.data import JOULE_PER_EV, REACTION_NUMBER
from openmc.data import JOULE_PER_EV, REACTION_MT
from openmc.lib import (
Tally, MaterialFilter, EnergyFilter, EnergyFunctionFilter)
import openmc.lib
@ -169,8 +169,7 @@ class FluxCollapseHelper(ReactionRateHelper):
self._materials = materials
# adds an entry for fisson to the dictionary of reactions
REACTION_NUMBER['fission'] = 18
self._mts = [REACTION_NUMBER[x] for x in scores]
self._mts = [REACTION_MT[x] for x in scores]
self._scores = scores
# Create flux tally with material and energy filters

View file

@ -309,7 +309,7 @@ def _calculate_cexs_nuclide(this, types, temperature=294., sab_name=None,
Nuclide object to source data from
types : Iterable of str or Integral
The type of cross sections to calculate; values can either be those
in openmc.PLOT_TYPES or keys from openmc.data.REACTION_NUMBER which
in openmc.PLOT_TYPES or keys from openmc.data.REACTION_MT which
correspond to a reaction description e.g '(n,2n)' or integers which
correspond to reaction channel (MT) numbers.
temperature : float, optional
@ -405,8 +405,8 @@ def _calculate_cexs_nuclide(this, types, temperature=294., sab_name=None,
ops.append((np.add,) * (len(tmp_mts) - 2) + (np.multiply,))
else:
ops.append((np.add,) * (len(tmp_mts) - 1))
elif line in openmc.data.REACTION_NUMBER.keys():
mt_number = openmc.data.REACTION_NUMBER[line]
elif line in openmc.data.REACTION_MT:
mt_number = openmc.data.REACTION_MT[line]
cv.check_type('MT in types', mt_number, Integral)
cv.check_greater_than('MT in types', mt_number, 0)
tmp_mts = nuc.get_reaction_components(mt_number)