def read_prmtop(prmpath: str):

    """This function parses a prmtop to extract atomic types/names and masses.

    Params:
      prmpath: the path to the prmtop file

    Returns:
       namelist: the atom names as a vector of strings.
       atommass: atomic masses as a vector of floats.

    """

    namelist = []
    atommass = []
    with open(prmpath) as f:
        for line in f:
            if "ATOM_NAME" in line:
                line = next(f)
                for line in f:
                    if "CHARGE" in line:
                        break
                    else:
                        line = line.strip("\n")
                        for c in range(0, len(line), 4):
                            namelist = namelist + [line[c : c + 3]]
            if "MASS" in line:
                line = next(f)
                for line in f:
                    if "ATOM_TYPE_INDEX" in line:
                        break
                    else:
                        a = line.split()
                        for x in a:
                            atommass.append(float(x))
    return namelist, atommass