Skip to main content

A contextmanager to track progress of joblib execution

Project description

joblib-progress

A contextmanager to track progress of joblib execution. joblib-progress

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.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

joblib_progress-1.0.2-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page