RxPy operator to distribute a computation with ray
Get Started
The distribute operator can be used directly in an existing pipeline to parallelize computations:
data = range(200)
ray.init()
rx.from_(data).pipe(
rxray.distribute(
lambda: rx.pipe(ops.map(lambda i: i*2)),
),
).subscribe()
When the distributed computation is stateful, items can be pinned to an actor with a key-based selector:
data = [(i, j) for i in range(17) for j in range(100)]
random.shuffle(data)
ray.init()
rx.from_(data).pipe(
rxray.distribute(
lambda: rx.pipe(
ops.group_by(lambda i: i[0]),
ops.flat_map(lambda g: g.pipe(
ops.map(lambda i: i[1]),
ops.average(),
ops.map(lambda i: (g.key, i)),
))
),
actor_selector=rxray.partition_by_key(lambda i: i[0]),
),
).subscribe()
Installation
RxRay is available on PyPi and can be installed with pip:
python3 -m pip install rxray
Release files for rxray 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rxray-1.0.0.tar.gz | 5.3 kB | Details |
Release files / rxray-1.0.0.tar.gz
| Download URL | rxray-1.0.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fa6f78f727d07ff5d26d65e3628673933a3aac69e4e60c4375ee5851fb6d141
|
|
BLAKE2b-256 checksum How to use checksums |
0421e812a3844b3ff8fc060c58164a6dfb7fc900eb4cbcbfd8c8adc69a7146b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|