def continuityGrouping(values, limit):
    """ #TODO docstring

    :param values: ``numpy.array`` containg ``int`` or ``float``, must be sorted
    :param limit: the maximal difference between two values, if this number is
        exceeded a new group is generated

    :returns: a list containing array start and end positions of continuous
        groups
    """
    lastValue = values[0]
    lastPos = 0
    groupStartPos = 0

    groupPos = list()
    for currPos, currValue in enumerate(values):
        if currValue - lastValue > limit:
            groupPos.append((groupStartPos, lastPos))
            groupStartPos = currPos
        lastPos = currPos
        lastValue = currValue
    groupPos.append((groupStartPos, lastPos))
    return groupPos
def continuityGrouping ( values , limit ) : lastValue = values [ 0 ] lastPos = 0 groupStartPos = 0 groupPos = list ( ) for currPos , currValue in enumerate ( values ) : if currValue - lastValue > limit : groupPos . append ( ( groupStartPos , lastPos ) ) groupStartPos = currPos lastPos = currPos lastValue = currValue groupPos . append ( ( groupStartPos , lastPos ) ) return groupPos
#TODO docstring

    :param values: ``numpy.array`` containg ``int`` or ``float``, must be sorted
    :param limit: the maximal difference between two values, if this number is
        exceeded a new group is generated

    :returns: a list containing array start and end positions of continuous
        groups