A contextmanager to track progress of joblib execution
Project description
joblib-progress
A contextmanager to track progress of joblib execution.
Install
> pip install joblib-progreess
Usage
If you know the number of items
from joblib_progress import joblib_progress
from joblib import Parallel, delayed
import time
def slow_square(i):
time.sleep(i / 2)
return i ** 2
with joblib_progress("Calculating square...", total=10):
Parallel(n_jobs=4)(delayed(slow_square)(number) for number in range(10))
If you don't know the number of items
with joblib_progress("Calculating square..."):
Parallel(n_jobs=4)(delayed(slow_square)(number) for number in range(10))
Acknowledgments
The idea of using joblib.parallel.BatchCompletionCallBack
is inspired from https://stackoverflow.com/a/58936697/5133167
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
joblib-progress-1.0.1.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for joblib_progress-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48e22fd3d6c1772dc51265dad65bd7336cb394615739c9c95b5ec80b6fcce2f6 |
|
MD5 | 0a64285af7d080fa4052b84e1c479a85 |
|
BLAKE2b-256 | 0a50d0cda45917e2b6c076d2b556806358e28fefc57a78eb7ee3f15923d650d2 |