def parse_sets_input(path):
    """ Reads a file containing the sets used for fitting.
        An asterisk before a group name indicates that model predictions
        should be subtracted from saved energies (relevant for self consistent
        training)
    Parameters
    ----------
    path: str
        Path to file containing dataset names

    Returns
    --------
    hdf5, list
        hdf5[0] : datafile location
        hdf5[1],hdf5[2]: lists of baseline(,target) datasets
    """
    hdf5 = ['', [], []]
    with open(path, 'r') as setsfile:
        line = setsfile.readline().rstrip()
        hdf5[0] = line  #datafile location
        line = setsfile.readline().rstrip()
        while (line):
            split = line.split()
            hdf5[1].append(split[0])
            hdf5[2].append(split[1])
            line = setsfile.readline().rstrip()
    return hdf5