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


from builtins import range
from molmod.units import angstrom, amu
import numpy as np
        N = len(data["symbols"])
        hessian = np.zeros((3*N, 3*N), float)
        tmp = hessian.ravel()
        counter = 0
        while True:
            line = f.readline()
            if line == " $END\n":
                break
            line = line[5:-1]
            for j in range(len(line)//15):
                tmp[counter] = float(line[j*15:(j+1)*15])
                counter += 1
        data["hessian"] = hessian


class MassParser(PunchParser):
    """Extracts ``masses`` from the punch file."""

    def test(self, line, data):
        """See :meth:`PunchParser.test`"""
        return "symbols" in data and line == "ATOMIC MASSES\n"

    def read(self, line, f, data):
        """See :meth:`PunchParser.read`"""
        N = len(data["symbols"])
        masses = np.zeros(N, float)
        counter = 0
        while counter < N:
            words = f.readline().split()
            for word in words:

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


# Path: molmod/io/gamess.py
from builtins import range
from molmod.units import angstrom, amu
import numpy as np

        N = len(data["symbols"])
        hessian = np.zeros((3*N, 3*N), float)
        tmp = hessian.ravel()
        counter = 0
        while True:
            line = f.readline()
            if line == " $END\n":
                break
            line = line[5:-1]
            for j in range(len(line)//15):
                tmp[counter] = float(line[j*15:(j+1)*15])
                counter += 1
        data["hessian"] = hessian


class MassParser(PunchParser):
    """Extracts ``masses`` from the punch file."""

    def test(self, line, data):
        """See :meth:`PunchParser.test`"""
        return "symbols" in data and line == "ATOMIC MASSES\n"

    def read(self, line, f, data):
        """See :meth:`PunchParser.read`"""
        N = len(data["symbols"])
        masses = np.zeros(N, float)
        counter = 0
        while counter < N:
            words = f.readline().split()
            for word in words:

                masses[counter] = float(word)*amu