Skip to main content

A framework for using remote lab instruments as local resources built on Pyro5

Project description

PyroLab


Development version Latest Commit

A framework for using remote lab instruments as local resources, built on Pyro5.

Developed by Sequoia Ploeg (for CamachoLab, Brigham Young University).

About

This project aims to allow all laboratory instruments to be accessed as local objects from a remote machine. Instruments that don't natively support such access, such as those required to be connected by a USB cable (or similar), are wrapped with a Pyro5 interface. However, this library may contain other instruments that are already internet-capable and don't rely on Pyro5. That's alright; we're just trying to create a minimal-dependency, one-stop-shop for laboratory instruments!

Example

First, make sure all your configuration files on the nameserver computer, service providing computer, and client are correct (with the proper keys and everything).

Run a nameserver:

import pyrolab.api
pyrolab.api.config.reset(use_file="/path/to/config.yaml")

pyrolab.api.start_ns_loop()

Provide a service:

import pyrolab.api
from pyrolab.drivers.sample import SampleService
pyrolab.api.config.reset(use_file="/path/to/config.yaml")

daemon = pyrolab.api.Daemon()
ns = pyrolab.api.locate_ns()
uri = daemon.register(SampleService)
ns.register("test.SampleService", uri)

try:
    daemon.requestLoop()
finally:
    ns.remove("test.SampleService")

Connect using a remote client:

from pyrolab.api import config, locate_ns, Proxy
config.reset(use_file="/path/to/config.yaml")

ns = pyrolab.api.locate_ns()
uri = ns.lookup("test.SampleService")

with Proxy(uri) as p:
    p.do_work()

FAQ's

  1. Another instrument library? What about all the others?
    In our experience, etc.

  2. Is this a standalone software that automatically supports all the advertised instruments?
    No; many of these instruments depend on other software already being installed. In particular, ThorLabs equipment depends on ThorLabs software already being installed on the computer connected to the physical hardware (but not on the remote computer!).

For Developers

Since the passing of data is, by definition, between hosts and over IP, PyroLab avoids the use of complex Python objects for return values that will be transmitted to remote machines. Since serialization is complicated, and security is even harder, we resort to using only basic Python types when interfacing with hardware (i.e., Python lists, ints, tuples, and not NumPy arrays, matplotlib plot objects, custom objects, etc.).

To bump version prior to a release, run one of the following commands:

bump2version major
bump2version minor
bump2version patch

Releases are automatically created when git tags matching the "v*" pattern are created.

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

PyroLab-0.1.0.tar.gz (22.4 kB view hashes)

Uploaded Source

Built Distribution

PyroLab-0.1.0-py3-none-any.whl (40.5 kB view hashes)

Uploaded Python 3

Supported by

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