def chunk(len_array, nb_chunks=3):
    """Chunks an array in a list of several equal (when odd) length chunks

    Parameters
    ----------
    len_array: int
        Length of the array to be chunked

    nb_chunks: int
        Number of chunks

    Returns
    -------
    Iterator
        e.g list(chunk(10, 3)) would return [(0, 3), (3, 6), (6, 10)]
    """
    assert nb_chunks <= len_array, "nb_chunks should be lower or equal than len_array"
    step = len_array // nb_chunks
    bounds = [x*step for x in range(nb_chunks)] + [len_array]
    return zip(bounds, bounds[1:])