(bounds, position, slice_size, regular=False)
return enforce_dtype(bounds_sliced, np.int32)
Slice data bounds in a *single* slice according to the VBOs slicing.
        
        Arguments:
          * bounds: the bounds as specified by the user in `create_dataset`.
          * position: the position of the current slice.
          * slice_size: the size of the current slice.
        
        Returns:
          * bounds_sliced: the bounds for the current slice. It is a list an
            1D array of integer indices.
Slice data bounds in a *single* slice according to the VBOs slicing.
        
        Arguments:
          * bounds: the bounds as specified by the user in `create_dataset`.
          * position: the position of the current slice.
          * slice_size: the size of the current slice.
        
        Returns:
          * bounds_sliced: the bounds for the current slice. It is a list an
            1D array of integer indices.
Slice data bounds in a * single * slice according to the VBOs slicing . Arguments : * bounds : the bounds as specified by the user in create_dataset . * position : the position of the current slice . * slice_size : the size of the current slice . Returns : * bounds_sliced : the bounds for the current slice . It is a list an 1D array of integer indices .
def _slice_bounds(bounds, position, slice_size, regular=False):
        """Slice data bounds in a *single* slice according to the VBOs slicing.
        
        Arguments:
          * bounds: the bounds as specified by the user in `create_dataset`.
          * position: the position of the current slice.
          * slice_size: the size of the current slice.
        
        Returns:
          * bounds_sliced: the bounds for the current slice. It is a list an
            1D array of integer indices.
        
        """
        # first bound index after the sliced VBO: nothing to paint
        if bounds[0] >= position + slice_size:
            bounds_sliced = None
        # last bound index before the sliced VBO: nothing to paint
        elif bounds[-1] < position:
            bounds_sliced = None
        # the current sliced VBO intersects the bounds: something to paint
        else:
            
            bounds_sliced = bounds
            
            if not regular:
                # get the bounds that fall within the sliced VBO
                ind = (bounds_sliced>=position) & (bounds_sliced<position + slice_size)
                bounds_sliced = bounds_sliced[ind]
            # HACK: more efficient algorithm when the bounds are regularly
            # spaced
            else:
                d = float(regular)
                p = position
                b0 = bounds_sliced[0]
                b1 = bounds_sliced[-1]
                s = slice_size
                i0 = max(0, int(np.ceil((p-b0)/d)))
                i1 = max(0, int(np.floor((p+s-b0)/d)))
                bounds_sliced = bounds_sliced[i0:i1+1].copy()
                ind = ((b0 >= p) and (b0 < p+s), (b1 >= p) and (b1 < p+s))
                """
                bounds_sliced = [b0 + d*i]
                (p-b0)/d <= i0 < (p+s-b0)/d
                i0 = ceil((p-b0)/d), i1 = floor((p+s-b0)/d)
                ind = (bs[0] >= p & < p+s, bs[-1])
                """
            
            # remove the onset (first index of the sliced VBO)
            bounds_sliced -= position
            # handle the case when the slice cuts between two bounds
            if not ind[0]:
                bounds_sliced = np.hstack((0, bounds_sliced))
            if not ind[-1]:
                bounds_sliced = np.hstack((bounds_sliced, slice_size))
        return enforce_dtype(bounds_sliced, np.int32)
def _slice_bounds ( bounds , position , slice_size , regular = False ) : # first bound index after the sliced VBO: nothing to paint if bounds [ 0 ] >= position + slice_size : bounds_sliced = None # last bound index before the sliced VBO: nothing to paint elif bounds [ - 1 ] < position : bounds_sliced = None # the current sliced VBO intersects the bounds: something to paint else : bounds_sliced = bounds if not regular : # get the bounds that fall within the sliced VBO ind = ( bounds_sliced >= position ) & ( bounds_sliced < position + slice_size ) bounds_sliced = bounds_sliced [ ind ] # HACK: more efficient algorithm when the bounds are regularly # spaced else : d = float ( regular ) p = position b0 = bounds_sliced [ 0 ] b1 = bounds_sliced [ - 1 ] s = slice_size i0 = max ( 0 , int ( np . ceil ( ( p - b0 ) / d ) ) ) i1 = max ( 0 , int ( np . floor ( ( p + s - b0 ) / d ) ) ) bounds_sliced = bounds_sliced [ i0 : i1 + 1 ] . copy ( ) ind = ( ( b0 >= p ) and ( b0 < p + s ) , ( b1 >= p ) and ( b1 < p + s ) ) """
                bounds_sliced = [b0 + d*i]
                (p-b0)/d <= i0 < (p+s-b0)/d
                i0 = ceil((p-b0)/d), i1 = floor((p+s-b0)/d)
                ind = (bs[0] >= p & < p+s, bs[-1])
                """ # remove the onset (first index of the sliced VBO) bounds_sliced -= position # handle the case when the slice cuts between two bounds if not ind [ 0 ] : bounds_sliced = np . hstack ( ( 0 , bounds_sliced ) ) if not ind [ - 1 ] : bounds_sliced = np . hstack ( ( bounds_sliced , slice_size ) ) return enforce_dtype ( bounds_sliced , np . int32 )