Skip to main content

A contextmanager to track progress of joblib execution

Project description

joblib-progress

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

Why

The vanilla multiprocessing does not work when an object to multiprocess is not pickle-able. The joblib solves this, but then its progress is not tracked nicely. This library solves that tracking issue with joblib.

Install

> pip install joblib-progreess

Usage

If you know the number of items

import time

from joblib import Parallel, delayed
from joblib_progress import joblib_progress


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 referenced 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.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

joblib_progress-1.0.3-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file joblib-progress-1.0.3.tar.gz.

File metadata

  • Download URL: joblib-progress-1.0.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for joblib-progress-1.0.3.tar.gz
Algorithm Hash digest
SHA256 79ce1b92a52bbc4955785a0ba7a4c819232b0f96c0d4ec91dae9c6c81b78f2b2
MD5 f9dbe822a28af407fdd50eba0ddbe863
BLAKE2b-256 ee1994e5d9c62f650467af4f477caf3b64fb08b194d075dd0fb7dd058de4ca8f

See more details on using hashes here.

File details

Details for the file joblib_progress-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for joblib_progress-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d3ed539b6e978017ec186b3f3f61f2c3af0647463a6469e82d5224e2c40e8fb3
MD5 5e455a4df50e78e1bfa883322de1403d
BLAKE2b-256 89bd94d8919fcb8f77ac275f58468e1a41a252f65e5ddf840d2bfd72815dee2f

See more details on using hashes here.

Supported by

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