def simple_nearest_indices(xs,res):
    '''
    Simple nearest interpolator that interpolates based on
    the minima and maxima of points based on the passed
    resolution in res.

    Parameters:
    -----------

    xs  -- A collection of `ndim` arrays of points.
    res -- List of resolutions.
    '''
    maxs = [max(a) for a in xs]
    mins = [min(a) for a in xs]
    XS = [np.linspace(mn, mx, r) for mn,mx,r in zip(mins,maxs,res)];
    XS = tuple(np.meshgrid(*XS,indexing='ij'));
    if type(xs) != tuple:
        xs = tuple(xs);
    return nearest_indices(xs,XS);
def simple_nearest_indices ( xs , res ) : maxs = [ max ( a ) for a in xs ] mins = [ min ( a ) for a in xs ] XS = [ np . linspace ( mn , mx , r ) for mn , mx , r in zip ( mins , maxs , res ) ] ; XS = tuple ( np . meshgrid ( * XS , indexing = 'ij' ) ) ; if type ( xs ) != tuple : xs = tuple ( xs ) ; return nearest_indices ( xs , XS ) ;
Simple nearest interpolator that interpolates based on
    the minima and maxima of points based on the passed
    resolution in res.

    Parameters:
    -----------

    xs  -- A collection of `ndim` arrays of points.
    res -- List of resolutions.