Skip to main content

A wrapper around Python's multiprocessing, providing support for tqdm progress bars and shared arguments

Project description

A wrapper around Python’s multiprocessing, providing support for tqdm progress bars and shared arguments.

Provides simple, familiar interface with addiitonal superpowers.

Installation

pip install enhanced_multiprocessing

Example usage

from enhanced_multiprocessing import Pool

def add_n(x, n):
    return x + n

# the number of processes will be set to number of cores - 1 by default
p = Pool()

# will apply add_n to the element list of length three with n=5, showing a nice progress bar along
result = p.imap(add_n, [1, 2, 3], shared_args=(5, ))

assert list(result) == [6, 7, 8]

History

Originally published at kn-bibs/pathways-analysis, then further developed for krassowski/drug-disease-profile-matching.

Project details


Release history Release notifications

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for enhanced-multiprocessing, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size enhanced_multiprocessing-1.0.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page