# Path: molmod/units.py
# def parse_unit(expression):


from builtins import range
from molmod.units import amu
import pkg_resources
       keys and the corresponding isotope masses in atomic units as values. E.g.
       self.masses[6][12] is the mass of carbon 12.

       If you use this interface, cite the following references:

       The AME2003 atomic mass evaluation (I). Evaluation of input data, adjustment
       procedures. A.H. Wapstra, G. Audi, and C. Thibault. Nuclear Physics A729,
       129 (2003).

       The AME2003 atomic mass evaluation (II). Tables, graphs, and references. G.
       Audi, A.H. Wapstra, and C. Thibault. Nuclear Physics A729, 337 (2003).
    """
    def __init__(self):
        """
           An object of this type is created in this module, so there is not
           need to construct it manually.
        """
        self.masses = {}

        def add_mass(N, Z, mass):
            """Put a new mass into the dictionary"""
            n_masses = self.masses.setdefault(Z, {})
            n_masses[Z+N] = mass

        with pkg_resources.resource_stream(__name__, 'data/mass.mas03') as f:
            for i in range(39):
                next(f)
            for line in f:
                N = int(line[ 5:10])
                Z = int(line[10:15])

# Path: molmod/units.py
# def parse_unit(expression):


# Path: molmod/isotopes.py
from builtins import range
from molmod.units import amu
import pkg_resources

       keys and the corresponding isotope masses in atomic units as values. E.g.
       self.masses[6][12] is the mass of carbon 12.

       If you use this interface, cite the following references:

       The AME2003 atomic mass evaluation (I). Evaluation of input data, adjustment
       procedures. A.H. Wapstra, G. Audi, and C. Thibault. Nuclear Physics A729,
       129 (2003).

       The AME2003 atomic mass evaluation (II). Tables, graphs, and references. G.
       Audi, A.H. Wapstra, and C. Thibault. Nuclear Physics A729, 337 (2003).
    """
    def __init__(self):
        """
           An object of this type is created in this module, so there is not
           need to construct it manually.
        """
        self.masses = {}

        def add_mass(N, Z, mass):
            """Put a new mass into the dictionary"""
            n_masses = self.masses.setdefault(Z, {})
            n_masses[Z+N] = mass

        with pkg_resources.resource_stream(__name__, 'data/mass.mas03') as f:
            for i in range(39):
                next(f)
            for line in f:
                N = int(line[ 5:10])
                Z = int(line[10:15])

                mass = float(line[96:114].replace(b" ", b"").replace(b"#", b""))*1e-6*amu