Moved _GND_NAME_RE with other global variables in data.py

This commit is contained in:
Paul Romano 2020-04-07 13:32:54 -05:00
parent 4943ae9307
commit 78b03bba8a

View file

@ -196,6 +196,9 @@ NEUTRON_MASS = 1.00866491588
# Used in atomic_mass function as a cache
_ATOMIC_MASS = {}
# Regex for GND nuclide names (used in zam function)
_GND_NAME_RE = re.compile(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)')
def atomic_mass(isotope):
"""Return atomic mass of isotope in atomic mass units.
@ -401,9 +404,6 @@ def gnd_name(Z, A, m=0):
return '{}{}'.format(ATOMIC_SYMBOL[Z], A)
_GND_NAME_RE = re.compile(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)')
def zam(name):
"""Return tuple of (atomic number, mass number, metastable state)