quimb.utils#
Miscellenous
Functions
|
|
|
|
|
Make sure |
|
Check if library is installed. |
|
Generate all unique bipartitions of |
|
|
|
Load an object form disk using joblib.load. |
|
Iterate over each pair of neighbours in |
|
|
|
|
|
Return function to flag up a missing necessary library. |
|
Save an object to disk using joblib.dump. |
Classes
|
Least recently used dict, which evicts old items. |
|
Decorator for making functions print their inputs. |
|
A continuous version of tqdm, so that it can be updated with a float within some pre-given range, rather than a number of steps. |
|
An ordered set which stores elements as the keys of dict (ordered as of python 3.6). |
- class quimb.utils.LRU(maxsize, *args, **kwds)[source]#
Least recently used dict, which evicts old items. Taken from python collections OrderedDict docs.
- class quimb.utils.Verbosify(fn, highlight=None, mpi=False)[source]#
Decorator for making functions print their inputs. Simply for illustrating a MPI example in the docs.
- class quimb.utils.continuous_progbar(*_, **__)[source]#
A continuous version of tqdm, so that it can be updated with a float within some pre-given range, rather than a number of steps.
- Parameters
args ((stop) or (start, stop)) – Stopping point (and starting point if
len(args) == 2
) of window within which to evaluate progress.total (int) – The number of steps to represent the continuous progress with.
kwargs – Supplied to
tqdm.tqdm
- quimb.utils.gen_bipartitions(it)[source]#
Generate all unique bipartitions of
it
. Unique meaning(1, 2), (3, 4)
is considered the same as(3, 4), (1, 2)
.
- class quimb.utils.oset(it=())[source]#
An ordered set which stores elements as the keys of dict (ordered as of python 3.6). ‘A few times’ slower than using a set directly for small sizes, but makes everything deterministic.