def _iter_chunked(x0, x1, chunksize=4, inc=1):
 if (inc == 0):
  raise ValueError('Cannot increment by zero.')
 if (chunksize <= 0):
  raise ValueError(('Chunk size must be positive; got %s.' % chunksize))
 s = (1 if (inc > 0) else (-1))
 stepsize = abs((chunksize * inc))
 x = x0
 while (((x - x1) * inc) < 0):
  delta = min(stepsize, abs((x - x1)))
  step = (delta * s)
  supp = np.arange(x, (x + step), inc)
  x += step
  (yield supp)

def _iter_chunked ( x0 , x1 , chunksize = 4 , inc = 1 ) : if ( inc == 0 ) : raise ValueError ( 'Cannot increment by zero.' ) if ( chunksize <= 0 ) : raise ValueError ( ( 'Chunk size must be positive; got %s.' % chunksize ) ) s = ( 1 if ( inc > 0 ) else ( - 1 ) ) stepsize = abs ( ( chunksize * inc ) ) x = x0 while ( ( ( x - x1 ) * inc ) < 0 ) : delta = min ( stepsize , abs ( ( x - x1 ) ) ) step = ( delta * s ) supp = np . arange ( x , ( x + step ) , inc ) x += step ( yield supp )
iterate from x0 to x1 in chunks of chunksize and steps inc .