Streams
Some text explaining.
API documentation
- bionumpy.streams.streamable(reduction: callable = None)[source]
A decorator to make a function applicable to streams of data
Examples
>>> from bionumpy.streams import streamable, BnpStream >>> @streamable(list) ... def add(a, b): ... return a + b
>>> add(10, 15) 25 >>> stream = BnpStream(iter(range(10))) >>> add(stream, 15) [15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
>>> @streamable(sum) ... def mul(a, b): ... return a * b >>> stream = BnpStream(iter([3, 4])) >>> mul(stream, 2) 14