npstreams.ipipe(*args, **kwargs)

Pipe arrays through a sequence of functions. For example:

pipe(f, g, h, stream) is equivalent to

for arr in stream:
    yield f(g(h(arr)))
  • *funcs (callable) – Callable that support Numpy arrays in their first argument. These should NOT be generator functions.

  • arrays (iterable) – Stream of arrays to be passed.

  • processes (int or None, optional, keyword-only) – Number of processes to use. If None, maximal number of processes is used. Default is one.

  • ntotal (int or None, optional, keyword-only) – If the length of arrays is known, but passing arrays as a list would take too much memory, the total number of arrays ntotal can be specified. This allows for pmap to chunk better in case of processes > 1.


piped (ndarray)