Metadata-Version: 1.1
Name: rxray
Version: 1.0.0
Summary: RxPY operators to distribute computations with ray
Home-page: https://github.com/maki-nage/rxray.git
Author: Romain Picard
Author-email: romain.picard@oakbits.com
License: MIT
Description: 
        =======================
        RxRay
        =======================
        
        .. image:: https://badge.fury.io/py/rxray.svg
            :target: https://badge.fury.io/py/rxray
        
        .. image:: https://github.com/maki-nage/rxray/workflows/Python%20package/badge.svg
            :target: https://github.com/maki-nage/rxray/actions?query=workflow%3A%22Python+package%22
            :alt: Github WorkFlows
        
        
        RxPy operator to distribute a computation with `ray <https://ray.io/>`_
        
        Get Started
        ============
        
        The distribute operator can be used directly in an existing pipeline to
        parallelize computations:
        
        .. code:: python3
        
            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:
        
        .. code:: python3
        
            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:
        
        .. code:: console
        
            python3 -m pip install rxray
        
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Distributed Computing
