Skip to main content

A simple implementation of the ray framework for method agnostic task paralellization.

Project description

Get Started

pip install ezRay

Quick Start Guide

from ezRay import MultiCoreExecutionTool
import ray

# configure ezRay
instance_metadata:dict = {
    'num_cpus': 4,              # number of cpus to use
    'num_gpus': 0,              # number of gpus to use
    'address': None,            # remote cluster address. None for local.
    }

# setup ezRay
MultiCore = MultiCoreExecutionTool(instance_metadata = instance_metadata)

# launch ray dashboard (optional)
MultiCore.launch_dashboard()

# define any task
def do_something(foo:int, bar:int) -> int:
    return foo + bar

# or use a ray.remote object
@ray.remote
def do_something_remote(foo:int, bar:int) -> int:
    return foo - bar

# prepare your data in a dictionary. They keys work as identifiers, while the values should be dictionaries matching the function signature.
data = {
    1:{'foo' : 0, 'bar' : 1},
    2:{'foo' : 1, 'bar' : 2},
    3:{'foo' : 2, 'bar' : 3}
    }

# pass the data to ezRay
MultiCore.update_data(data)

# run the task
MultiCore.run(do_something)

# get the results
results_first_task = MultiCore.get_results()

## prepare for the next run
# this will automaticall archive current results
# alternatively you can use MultiCore.archive_results()
MultiCore.next()

# run a second task
MultiCore.run(do_something_remote)

# get current results
results_second_task = MultiCore.get_results()

# get the archived results
archive = MultiCore.get_archive()

Documentation

Pending, sry. No time. However, check out the sandbox in the examples folder or the docstrings in the code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezray-1.1.8.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezray-1.1.8-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file ezray-1.1.8.tar.gz.

File metadata

  • Download URL: ezray-1.1.8.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.8 Windows/10

File hashes

Hashes for ezray-1.1.8.tar.gz
Algorithm Hash digest
SHA256 8278805e40540f9f6503fe740044fd2dc5922289bc9022e08da32ad62a9eddd6
MD5 ff1a025e5aa2cc7ff9a6a1fe9da59cac
BLAKE2b-256 fb3995af6a6a25bd48b98f2688ac83a9bdfde0fc6cda91077175cc999893522e

See more details on using hashes here.

File details

Details for the file ezray-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: ezray-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.8 Windows/10

File hashes

Hashes for ezray-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d976dc034b616011f6d6d9cc60df927bc674d6a4d0c652b731cbecd6147e19dd
MD5 21c3115a47fe30c3221eebb154a45efb
BLAKE2b-256 2702a3c61f547abacab0bb79b42c91911b077f0ea42b569cd4d54867a9a0c06c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page