https://github.com/krassowski/enhanced-multiprocessing
A wrapper around Python's multiprocessing, providing support for tqdm progress bars and shared arguments
https://github.com/krassowski/enhanced-multiprocessing
enhancement multiprocessing python3
Last synced: 14 days ago
JSON representation
A wrapper around Python's multiprocessing, providing support for tqdm progress bars and shared arguments
- Host: GitHub
- URL: https://github.com/krassowski/enhanced-multiprocessing
- Owner: krassowski
- License: mit
- Created: 2019-07-11T17:35:24.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-11T18:59:17.000Z (about 6 years ago)
- Last Synced: 2025-01-06T16:10:45.164Z (9 months ago)
- Topics: enhancement, multiprocessing, python3
- Language: Python
- Size: 9.77 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Enhanced multiprocessing
A wrapper around Python's multiprocessing, providing support for tqdm progress bars and shared arguments.
Provides simple, familiar interface with additional superpowers.
### Installation
```bash
pip install enhanced_multiprocessing
```### Example usage
```python
from enhanced_multiprocessing import Pooldef 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](https://github.com/kn-bibs/pathways-analysis/), then further developed for [krassowski/drug-disease-profile-matching](https://github.com/krassowski/drug-disease-profile-matching).