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


from builtins import range
from molmod.units import angstrom, amu
import numpy as np
                symbols.append(line.split()[0])
        data["symbols"] = symbols



class CoordinateParser(PunchParser):
    """Extracts ``numbers`` and ``coordinates`` from the punch file."""

    def test(self, line, data):
        """See :meth:`PunchParser.test`"""
        return "symbols" in data and line == " COORDINATES OF SYMMETRY UNIQUE ATOMS (ANGS)\n"

    def read(self, line, f, data):
        """See :meth:`PunchParser.read`"""
        f.readline()
        f.readline()
        N = len(data["symbols"])
        # if the data are already read before, just overwrite them
        numbers = data.get("numbers")
        if numbers is None:
            numbers = np.zeros(N, int)
            data["numbers"] = numbers
        coordinates = data.get("coordinates")
        if coordinates is None:
            coordinates = np.zeros((N,3), float)
            data["coordinates"] = coordinates
        for i in range(N):
            words = f.readline().split()
            numbers[i] = int(float(words[1]))
            coordinates[i,0] = float(words[2])*angstrom

# 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

                symbols.append(line.split()[0])
        data["symbols"] = symbols



class CoordinateParser(PunchParser):
    """Extracts ``numbers`` and ``coordinates`` from the punch file."""

    def test(self, line, data):
        """See :meth:`PunchParser.test`"""
        return "symbols" in data and line == " COORDINATES OF SYMMETRY UNIQUE ATOMS (ANGS)\n"

    def read(self, line, f, data):
        """See :meth:`PunchParser.read`"""
        f.readline()
        f.readline()
        N = len(data["symbols"])
        # if the data are already read before, just overwrite them
        numbers = data.get("numbers")
        if numbers is None:
            numbers = np.zeros(N, int)
            data["numbers"] = numbers
        coordinates = data.get("coordinates")
        if coordinates is None:
            coordinates = np.zeros((N,3), float)
            data["coordinates"] = coordinates
        for i in range(N):
            words = f.readline().split()
            numbers[i] = int(float(words[1]))
            coordinates[i,0] = float(words[2])*angstrom

            coordinates[i,1] = float(words[3])*angstrom