def check_n_points(n_points, n_dim):
    """
    Returns n_partitions or a numeric value associated with the exception message.
    """

    if n_dim == 1:
        return [0]
    
    I = n_dim * np.eye(n_dim)
    W = np.zeros((1, n_dim))
    edgeW = W
    i = 0

    while len(W) < n_points:
        edgeW = np.tile(edgeW, (n_dim, 1)) + np.repeat(I, edgeW.shape[0], axis=0)
        edgeW = np.unique(edgeW, axis=0)
        edgeW = edgeW [np.any(edgeW == 0, axis=1)]
        W = np.vstack((W + 1, edgeW))
        i += 1

    if len(W) == n_points:
        return [i]
    
    return  [len(W) - len(edgeW), i - 1, len(W), i]

    Returns n_partitions or a numeric value associated with the exception message.
    
pymoo/util/ref_dirs/incremental.py