pyslim/spatial.py
def _in_location_bin(locations, x0, x1, y0, y1):
    '''
    Takes the locations of individuals and tests if each is within [x0, x1) and
    [y0, y1). Returns a list the same length as the number of individuals with
    True if the corresponding individual is within the bounds and False
    otherwise.  This is a helper function for `population_size`, and may change
    or be removed in the future.

    :param array locations: An n x 3 array with rows individuals, the first
        column the x coordinates, and the second column the y coordinates.
    :param float x0: The lower x coordinate boundary.
    :param float x1: The upper x coordinate boundary.
    :param float y0: The lower y coordinate boundary.
    :param float y1: The upper y coordinate boundary.
    '''
    return np.logical_and(
            np.logical_and(
                locations[:,0] < x1,
                locations[:,0] >= x0),
            np.logical_and(
                locations[:,1] < y1,
                locations[:,1] >= y0
            )
        )

    Takes the locations of individuals and tests if each is within [x0, x1) and
    [y0, y1). Returns a list the same length as the number of individuals with
    True if the corresponding individual is within the bounds and False
    otherwise.  This is a helper function for `population_size`, and may change
    or be removed in the future.

    :param array locations: An n x 3 array with rows individuals, the first
        column the x coordinates, and the second column the y coordinates.
    :param float x0: The lower x coordinate boundary.
    :param float x1: The upper x coordinate boundary.
    :param float y0: The lower y coordinate boundary.
    :param float y1: The upper y coordinate boundary.
    
Takes the locations of individuals and tests if each is within [x0, x1) and
[y0, y1). Returns a list the same length as the number of individuals with
True if the corresponding individual is within the bounds and False
otherwise.  This is a helper function for `population_size`, and may change
or be removed in the future.
Takes the locations of individuals and tests if each is within [ x0 x1 ) and [ y0 y1 ) . Returns a list the same length as the number of individuals with True if the corresponding individual is within the bounds and False otherwise . This is a helper function for ` population_size ` and may change or be removed in the future .
def _in_location_bin(locations, x0, x1, y0, y1):
    return np.logical_and(
            np.logical_and(
                locations[:,0] < x1,
                locations[:,0] >= x0),
            np.logical_and(
                locations[:,1] < y1,
                locations[:,1] >= y0
            )
        )
def _in_location_bin ( locations , x0 , x1 , y0 , y1 ) : return np . logical_and ( np . logical_and ( locations [ : , 0 ] < x1 , locations [ : , 0 ] >= x0 ) , np . logical_and ( locations [ : , 1 ] < y1 , locations [ : , 1 ] >= y0 ) )
Takes the locations of individuals and tests if each is within [x0, x1) and
[y0, y1).
Takes the locations of individuals and tests if each is within [ x0 x1 ) and [ y0 y1 ) .
'''
    Takes the locations of individuals and tests if each is within [x0, x1) and
    [y0, y1). Returns a list the same length as the number of individuals with
    True if the corresponding individual is within the bounds and False
    otherwise.  This is a helper function for `population_size`, and may change
    or be removed in the future.

    :param array locations: An n x 3 array with rows individuals, the first
        column the x coordinates, and the second column the y coordinates.
    :param float x0: The lower x coordinate boundary.
    :param float x1: The upper x coordinate boundary.
    :param float y0: The lower y coordinate boundary.
    :param float y1: The upper y coordinate boundary.
    '''
locations
An n x 3 array with rows individuals, the first
column the x coordinates, and the second column the y coordinates.
An n x 3 array with rows individuals the first column the x coordinates and the second column the y coordinates .
x0
The lower x coordinate boundary.
The lower x coordinate boundary .
x1
The upper x coordinate boundary.
The upper x coordinate boundary .
y0
The lower y coordinate boundary.
The lower y coordinate boundary .
y1
The upper y coordinate boundary.
The upper y coordinate boundary .