Updated regex to cross reference nuclides with elements

This commit is contained in:
Will Boyd 2017-01-20 13:21:06 -05:00
parent 4100e97b00
commit 7900ad925a

View file

@ -200,7 +200,7 @@ def atomic_weight(element):
"""
weight = 0.
for nuclide, abundance in NATURAL_ABUNDANCE.items():
if re.match(element, nuclide):
if re.match(r'{}\d+'.format(element), nuclide):
weight += atomic_mass(nuclide) * abundance
return None if weight == 0. else weight