Pyturbo Package
Author: Lijun Yu
Email: lijun@lj-y.com
A pipeline system for efficient execution.
Installation
pip install py-turbo
Introduction
Pyturbo utilizes multiple level of abstract to efficiently execute parallel tasks.
- Worker: a process.
- Stage: a group of peer workers processing the same type of tasks.
- Task: a data unit transferred between stages. At each stage, a task is processed by one worker and will result in one or multiple downstream tasks.
- Pipeline: a set of sequential stages.
- Job: a data unit for a pipeline, typically a wrapped task for the first stage.
- Result: output of a job processed by one pipeline, typically a set of output tasks from the last stage.
- System: a set of peer pipelines processing the same type of jobs.
Get Started
from pyturbo import ReorderStage, Stage, System
class Stage1(Stage): # Define a stage
def __init__(self, resources):
... # Optional: set resources and number of workers
def process(self, task):
... # Process function for each worker process. Returns one or a series of downstream tasks.
... # Repeat for Stage2, Stage3
class Stage4(ReorderStage): # Define a reorder stage, typically for the final stage
def get_sequence_id(self, task):
... # Return the order of each task. Start from 0.
def process(self, task):
...
class MySystem(System):
def get_stages(self, resources):
... # Define the stages in a pipeline with given resources.
def get_results(self, results_gen):
... # Define how to extract final results from output tasks.
def main():
system = MySystem(num_pipeline) # Set debug=True to run in a single process
system.start() # Build and start system
jobs = [...]
system.add_jobs(jobs) # Submit jobs
for job in system.wait_jobs(len(jobs)):
print(job.results) # Process result
system.end() # End system
Options
See options.md
Demo
See demo.py for an example implementation.
Version History
See version.md.
Metadata
Release files for py-turbo 0.6.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py-turbo-0.6.7.tar.gz | 22.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_turbo-0.6.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.7 kB
Release files / py-turbo-0.6.7.tar.gz
| Download URL | py-turbo-0.6.7.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4322b6ab7ac98cf9142ea4d5855fce0fc40c9ca805cb3170f6505af9b597b48
|
|
BLAKE2b-256 checksum How to use checksums |
3954fe4d09bac1d094dd746de87c608df27a7cfe036b557656488dbc497f5ed3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / py_turbo-0.6.7-py3-none-any.whl
| Download URL | py_turbo-0.6.7-py3-none-any.whl |
|---|---|
| Size | 25.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ff5fa358e705086d49ebd3dbf6488aa5731e67d9795fafadfa5672d6e75ad9f
|
|
BLAKE2b-256 checksum How to use checksums |
e269e8bfb7eeeb82e1c5d547ee8a82677be6a65e0443d4631e5a6a4ca5e67e1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|