Run parallel jobs and save results to json.gz files
Project description
Run parallel jobs and save results to json.gz files.
Install
Stable:
pip install ultrachronic
Latest:
pip install git+https://github.com/yoavram/ultrachronic.git
Supports Python 3.4 and 3.5.
Test
Requirements:
pip install nose click
Run:
nosetests tests
Example
Code in do_something.py:
from ultrachronic import jsonify_result, repeat
import click
@jsonify_result
def do_something(arg1, arg2):
a = 1
b = 2
# must return a dict!
return dict(a=a, b=b)
@click.command()
@click.option('--arg1', default=1, type=int, help='Argument 1')
@click.option('--arg2', default='a', type=str, help='Argument 2')
@click.option('--reps', default=1, type=click.IntRange(1, None), help='Number of repetitions')
@click.option('--cpus', default=1, type=int, help='Number of CPUs to use (<1 for all available)')
def main(arg1, arg2, reps, cpus):
repeat(do_something, reps, cpus, arg1=arg1, arg2=arg2)
if __name__ == '__main__':
main()
Usage:
python do_something.py
python do_something.py --reps 10 --cpus 2
python do_something.py --arg1 5 --reps 10 --cpus 1
python do_something.py --arg2 hi --reps 10 --cpus 0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ultrachronic-0.1.5.tar.gz.
File metadata
- Download URL: ultrachronic-0.1.5.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbb76a46303d7e9e9c45ac8e57c5f60ff8bcdf561ec40ed77a180b69f0c0b5a1
|
|
| MD5 |
fad40bbcd510cec332636eb7882e21ee
|
|
| BLAKE2b-256 |
8c9f4052a23c9726f3c9f714b6d72f22516825b659991e14a9e6bc508a55354f
|
File details
Details for the file ultrachronic-0.1.5-py3.6.egg.
File metadata
- Download URL: ultrachronic-0.1.5-py3.6.egg
- Upload date:
- Size: 5.7 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bb31c24d1dd97a2a2035588424807904302db9eac3c3d081257f4fbaeb1e08f
|
|
| MD5 |
4342913d8488801ded2c75ddcb08836e
|
|
| BLAKE2b-256 |
42128ef41e485670ab9c42a746548fc3ebb274c9d1396b80b38758289732c1da
|
File details
Details for the file ultrachronic-0.1.5-py3.5.egg.
File metadata
- Download URL: ultrachronic-0.1.5-py3.5.egg
- Upload date:
- Size: 5.8 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5280946a3c26b86c8cfcfcb150ccd12cbe2da555513e3ad261e98c1d743ad08b
|
|
| MD5 |
19e69a33a68fbf47223b7b490495fc61
|
|
| BLAKE2b-256 |
a681656e983f559b9f1cabb5875dddb5fc2c32b97725387783f115628150d283
|
File details
Details for the file ultrachronic-0.1.5-py3.4.egg.
File metadata
- Download URL: ultrachronic-0.1.5-py3.4.egg
- Upload date:
- Size: 5.8 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a47382904a88b4afc996511b32443ca7a98baeacc21f14daf4e8ab0c4a36e68e
|
|
| MD5 |
74be9ca2de59c75e633c5b7d398dbb59
|
|
| BLAKE2b-256 |
f7bce96719656b272d36c9c8fac5be186d7e9535b1dde1ae992828b7626421a2
|
File details
Details for the file ultrachronic-0.1.5-py2.py3-none-any.whl.
File metadata
- Download URL: ultrachronic-0.1.5-py2.py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b85d6943431dc9604a17cb6c5530251a508e3f55b802bbf3b2877113a63d4c87
|
|
| MD5 |
0237219db3dc4d2b9ecd53a0026066ff
|
|
| BLAKE2b-256 |
c24a85fc6cfbad2fe5158385bf1c3c6245cb79e4f8ba609ca890b88482e45bd0
|