Skip to main content

Welcome to PyAres

PyAres is the official Python library for ARES OS, designed to bridge the gap between laboratory automation and accessible scientific research.

PyAres enables developers and researchers to create Planners, Analyzers, and Devices using Python, fully integrating them into the ARES ecosystem without requiring knowledge of C# or modifications to the ARES Core.

Project Philosophy

The core philosophy behind PyAres is accessibility. While the ARES Core is built on high-performance C#, we recognize that Python is the language of choice for the wider scientific community.

PyAres decouples the engineering complexity from the scientific logic. It allows researchers to leverage the vast ecosystem of Python scientific libraries (NumPy, PyTorch, OpenCV, etc.) to drive experiments, while ARES handles the heavy lifting of orchestration and system stability.

Architecture

PyAres functions as a microservice framework. Communications between your Python scripts and the ARES core are handled via gRPC and Protobuf.

  • Language Agnostic: Because of this architecture, ARES treats PyAres components like any other ARES component. A Python-based device is indistinguishable from the native C# device to ARES OS.
  • Distributed Capabilities: PyAres services do not need to run on the same machine as the ARES core. You can host computationally heavy services (for example, machine vision models) on a dedicated GPU machine while ARES runs on the main control PC.

Core Components

You can build three types of services/extensions/components using PyAres:

1. Planners
Planners define the decision-making logic for "Self-Driving" loops.

  • Input: Current experiment parameters, constraints, and past experiment data including analyzer objectives and previous outcomes.
  • Output: The next set of experimental conditions.
  • Use Case: Iterative optimization, Bayesian optimization, or simple step-wise logic.

2. Analyzers
Analyzers process raw data to return structured results.

  • Input: Raw data (images, sensor logs, data streams).
  • Output: One or more objective values plus a success/failure outcome (and optionally other calculated metrics).
  • Use Case: Analyze a photo of a 3D print to detect failures or calculate growth rates from sensor data.

3. Devices
Devices provide the interface between ARES and physical hardware.

  • Input: Commands from ARES (for example, set_temperature, set_flowrate).
  • Output: State data and command confirmations.
  • Use Case: Integrating a custom sensor, a serial device, or a specialized camera using Python drivers.

Integration Workflow

PyAres uses a manual registration model for services to ensure reliability in complex network environments. Below we'll describe the process for a "Device" service, but the process is very similar for the other services listed under core components.

  1. Launch Service Start your PyAres script (for example, python my_device.py). It will listen on a specific address (for example, http://localhost:7800).
  2. Register in ARES
    • Navigate to the Settings menu in ARES OS.
    • In the Device tab, select "Remote".
    • Press the small "plus" button on the right side of your screen.
    • Input the name and Address (IP and Port) of your running Python service.
  3. Persistence: ARES saves this configuration to its database. On subsequent startups, ARES will automatically attempt to reconnect to the registered address and handshake with your Python service to retrieve its capabilities.

Once registered, you can now connect and control new hardware, making your implementations ARES ready as a PyAres Device.

Getting Started

To install the library, see installation.

If you want to get hands-on quickly, the Quick Start walks through running one Planner, Analyzer, and Device end to end.

For deeper dives into each component, see:

Check the sidebar for detailed guides on building your first Planner, Analyzer, or Device.