mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Added conditional to pass qualifying S(a,b) names through converter method
This commit is contained in:
parent
fe63a59c5b
commit
b791450b75
1 changed files with 4 additions and 2 deletions
|
|
@ -43,7 +43,9 @@ _THERMAL_NAMES = {'al': 'c_Al27', 'al27': 'c_Al27',
|
|||
def get_thermal_name(name):
|
||||
"""Get proper S(a,b) table name, e.g. 'HH2O' -> 'c_H_in_H2O'"""
|
||||
|
||||
if name.lower() in _THERMAL_NAMES:
|
||||
if name in _THERMAL_NAMES.values():
|
||||
return name
|
||||
elif name.lower() in _THERMAL_NAMES:
|
||||
return _THERMAL_NAMES[name.lower()]
|
||||
else:
|
||||
# Make an educated guess?? This actually works well for
|
||||
|
|
@ -52,7 +54,7 @@ def get_thermal_name(name):
|
|||
matches = get_close_matches(
|
||||
name.lower(), _THERMAL_NAMES.keys(), cutoff=0.5)
|
||||
if len(matches) > 0:
|
||||
return _THERMAL_NAMES[matches[0]] + '.' + xs
|
||||
return _THERMAL_NAMES[matches[0]]
|
||||
else:
|
||||
# OK, we give up. Just use the ACE name.
|
||||
return 'c_' + name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue