Releases: sekgobela-kevin/prodius
prodius v0.0.2
First release of prodius library for calculating cartesian product as based on perock library.
Prodius allows iterables of cartesian product to be callable which avoid wring iterables to memory.
This avoid MemoryError when a very large iterable when calculating catesian product.
rodius allows iterable to be used in cartesian product to be a
callable but also allowing iterable. Perock only expected iterables to only
contain callables or iterables not both. It was fixed in this commit and now
iterable can contain iterables and callables.
No matter how large iterable is, memory error will be avoided if iterable is
passed as callable e.g function. Intead of reading whole iterator into memory,
callable is called to get items of iterator again.
Using callable like function gives opportunity to change items of iterator that will
be used in each level. itertools.product()
does not provide that particular behavious
as it expects iterable and its impossible to know if levels changed.
Limitations
- Callables or iterables are limited to 11 with repeat included.
- Lot of function calls which may lead to poor performance(not tested).