def _chunk_data(X, slices):
 slices = [sl for sl in slices if len(sl)]
 selected_times = np.hstack([np.ravel(sl) for sl in slices])
 start = np.min(selected_times)
 stop = (np.max(selected_times) + 1)
 slices_chunk = [(sl - start) for sl in slices]
 X_chunk = X[:, :, start:stop]
 return (X_chunk, slices_chunk)

def _chunk_data ( X , slices ) : slices = [ sl for sl in slices if len ( sl ) ] selected_times = np . hstack ( [ np . ravel ( sl ) for sl in slices ] ) start = np . min ( selected_times ) stop = ( np . max ( selected_times ) + 1 ) slices_chunk = [ ( sl - start ) for sl in slices ] X_chunk = X [ : , : , start : stop ] return ( X_chunk , slices_chunk )
smart chunking to avoid memory overload .