parse a pest template file to get the parameter names

    Parameters
    ----------
    tpl_file : str
        template file name

    Returns
    -------
    par_names : list
        list of parameter names

def parse_tpl_file(tpl_file):
    """ parse a pest template file to get the parameter names

    Parameters
    ----------
    tpl_file : str
        template file name

    Returns
    -------
    par_names : list
        list of parameter names

    """
    par_names = set()
    with open(tpl_file,'r') as f:
        try:
            header = f.readline().strip().split()
            assert header[0].lower() in ["ptf","jtf"],\
                "template file error: must start with [ptf,jtf], not:" +\
                str(header[0])
            assert len(header) == 2,\
                "template file error: header line must have two entries: " +\
                str(header)

            marker = header[1]
            assert len(marker) == 1,\
                "template file error: marker must be a single character, not:" +\
                str(marker)
            for line in f:
                par_line = set(line.lower().strip().split(marker)[1::2])
                par_names.update(par_line)
                #par_names.extend(par_line)
                #for p in par_line:
                #    if p not in par_names:
                #        par_names.append(p)
        except Exception as e:
            raise Exception("error processing template file " +\
                            tpl_file+" :\n" + str(e))
    #par_names = [pn.strip().lower() for pn in par_names]
    #seen = set()
    #seen_add = seen.add
    #return [x for x in par_names if not (x in seen or seen_add(x))]
    return [p.strip() for p in list(par_names)]