Skip to main content

tqdm_pathos

Progress bars for multiprocessing with pathos

Wrappers based on parmap for multiprocessing with pathos and progress bar completion with tqdm. Following parmap, multiprocessing is extended to functions of multiple iterables, arguments, and keyword arguments.

While parmap includes these extensions and a progress bar, it is built on the default multiprocessing library. The multiprocessing/pools module in pathos includes enhanced serialization to allow multiprocessing of, e.g., lambda functions, class methods, etc.

Installation

You can pip install tqdm-pathos.

Usage

A pool with an automatically detected number of cores is set up by default. To choose the number of cores, use the n_cpus kwarg. Alternatively, an existing pool can be used by passing it to the pool kwarg. Extra kwargs can be passed to the tqdm progress bar using the tqdm_kwargs dictionary argument, e.g., tqdm_kwargs = {'desc': 'pbar description'}.

Function of a single iterable:

f = lambda x: x**2
iterable = [1, 2, 3]

# Serial
y = [f(x) for x in iterable]

# Parallel
y = tqdm_pathos.map(f, iterable)

Function of a single iterable, with non-iterable args and kwargs:

def f(x, a, b=0):
    return x**2 * a + b
iterable = [1, 2, 3]
a = 1
b = 0
    
# Serial
y = [f(x, a, b=b) for x in iterable]

# Parallel
y = tqdm_pathos.map(f, iterable, a, b=b)

Function of multiple iterables:

f = lambda x, y: x * y
iterable1 = [1, 2, 3]
iterable2 = [4, 5, 6]

# Serial
z = [f(x, y) for x, y in zip(iterable1, iterable2)]

# Parallel
z = tqdm_pathos.starmap(f, zip(iterable1, iterable2))

Function of multiple iterables, with non-iterable args and kwargs:

def f(x, y, a, b=0):
    return x * y * a + b
iterable1 = [1, 2, 3]
iterable2 = [4, 5, 6]
a = 1
b = 0

# Serial
z = [f(x, y, a, b=b) for x, y in zip(iterable1, iterable2)]

# Parallel
z = tqdm_pathos.starmap(f, zip(iterable1, iterable2), a, b=b)

Metadata

Release files for tqdm-pathos 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tqdm-pathos 0.4
File Size Uploaded Provenance Actions
tqdm_pathos-0.4.tar.gz 7.0 kB Without provenance Details for tqdm_pathos-0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tqdm-pathos 0.4
File Interpreter ABI Platform Actions
tqdm_pathos-0.4-py3-none-any.whl Python 3 none any Details for tqdm_pathos-0.4-py3-none-any.whl

Total release size: 14.4 kB

Release files / tqdm_pathos-0.4.tar.gz

Download URL tqdm_pathos-0.4.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8ec3b52475c10ea7a80ed858f775f0f7a21e1cca13bee990c3523859bb639f1b
BLAKE2b-256 checksum
How to use checksums
ef1144d8c1f4e398cffd9314512358d9b700ae5823fd9bd73a295faca91f0ada
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / tqdm_pathos-0.4-py3-none-any.whl

Download URL tqdm_pathos-0.4-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c16852b00035e431709b7e558afadde20d4b868e81e028cda8a3ac452b617a8
BLAKE2b-256 checksum
How to use checksums
02df267827df1ed8c4830af28653392dea042897a486576e5990a4d27f0257cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for tqdm-pathos 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page