def _gen_closest_index(x, points):
    """
    Generates the closes index to the point x.

    Not that this is not a hard index, but may vary up to +/- 1 in each dim.

    Parameters
    ----------
    x : list
        The [0, 1] hypercube coordinates for x.
    points : int
        The number of points in each dimension.

    Returns
    -------
    closest_index : tuple
        Indexing tuple for the closest point.
    """
    closest_index = []
    for i in range(len(x)):
        closest_index.append(int(x[i] * points))
    return tuple(closest_index)
