Address #1333 comment

This commit is contained in:
Sterling Harper 2019-09-06 09:52:49 -04:00
parent 862524c26a
commit 35c9f406b4
2 changed files with 6 additions and 3 deletions

View file

@ -358,7 +358,12 @@ def zam(name):
symbol, A, state = _GND_NAME_RE.match(name).groups()
except AttributeError:
raise ValueError("'{}' does not appear to be a nuclide name in GND "
"format.".format(name))
"format".format(name))
if symbol not in ATOMIC_NUMBER:
raise ValueError("'{}' is not a recognized element symbol"
.format(symbol))
metastable = int(state[2:]) if state else 0
return (ATOMIC_NUMBER[symbol], int(A), metastable)

View file

@ -413,8 +413,6 @@ class Material(IDManagerMixin):
Z, _, _ = openmc.data.zam(nuclide)
except ValueError as e:
warnings.warn(str(e))
except KeyError as e:
warnings.warn(repr(e))
else:
# For actinides, have the material be depletable by default
if Z >= 89: