Streaming extension
Extension providing streaming and chunked processing capabilities.
- on
Methods
-
batchProcess(
{required int axis, required int chunkSize, required int batchSize, required void processor(List< NDArray> batch)}) → Future<void> - Processes chunks in batches for better performance.
-
filterChunks(
{required int axis, required int chunkSize, required bool predicate(NDArray chunk)}) → Future< List< NDArray> > - Filters chunks based on a predicate.
-
mapChunks<
T> ({required int axis, required int chunkSize, required T mapper(NDArray chunk)}) → Future< List< T> > - Applies a function to each chunk and collects results.
-
mapReduce<
T, R> ({required int axis, required int chunkSize, required T mapper(NDArray chunk), required R reducer(R accumulator, T value), required R initialValue}) → Future< R> - Processes the array in chunks with a map-reduce pattern.
-
processChunked<
R> ({required int axis, required int chunkSize, required dynamic processor(NDArray chunk), required R combiner(List results)}) → Future< R> - Processes the array in chunks along an axis.
-
rollingAggregate<
T> ({required int axis, required int windowSize, required T aggregator(NDArray window), int step = 1}) → Future< List< T> > - Applies a rolling aggregation along an axis.
-
slidingWindow(
{required int axis, required int windowSize, int step = 1}) → Stream< NDArray> - Iterates through the array with a sliding window.
-
streamAlongAxis(
int axis, {int chunkSize = 1}) → Stream< NDArray> - Streams slices along a specific axis.