jztools.parallelization.mock#
Classes
|
Mock implementation of |
|
|
|
https://stackoverflow.com/questions/10434593/dummyexecutor-for-pythons-futures |
- class jztools.parallelization.mock.MockFuture(task, lazy=False)#
Bases:
FutureMock implementation of
Future.Initializes the future. Should not be called by clients.
- class jztools.parallelization.mock.MockPoolExecutor(*args, **kwargs)#
Bases:
Executorhttps://stackoverflow.com/questions/10434593/dummyexecutor-for-pythons-futures
- submit(fn, *args, **kwargs)#
Todo
Computation should not happen here, but rather when checking for results.
- shutdown(wait=True)#
Clean-up the resources associated with the Executor.
It is safe to call this method several times. Otherwise, no other methods can be called after this one.
- Args:
- wait: If True then shutdown will not return until all running
futures have finished executing and the resources used by the executor have been reclaimed.
- class jztools.parallelization.mock.MockParallelizer(do_raise: bool = False, verbose=False, tqdm_kwargs={}, **pool_executor_kwargs)#
Bases:
_Parallelizer- Parameters:
do_raise – If
True, Raise an exception as soon as it is received internally. Otherwise, will return the exception object.verbose – Use
tqdmto display progress.tqdm_kwargs – Dictionary of keyword arguments passed to tqdm.
pool_executor_kwargs – Variable keyword args passed to the pool executor initializer.
- PoolExecutor#
alias of
MockPoolExecutor