A framework for using remote lab instruments as local resources built on Pyro5
Project description
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
-
Another instrument library? What about all the others?
In our experience, etc. -
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file PyroLab-0.1.0.tar.gz
.
File metadata
- Download URL: PyroLab-0.1.0.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1562875a3b5d50a74640e3e17c59bf0670114efb9684ca827b4a20f6d9d4a39c |
|
MD5 | 958bd9a6fe1f6fd8274b3d36b1b9b12a |
|
BLAKE2b-256 | 16c054f4fca2fb1af02cea8ad23413150dff3ecbf97ec86f5094954869794f82 |
File details
Details for the file PyroLab-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: PyroLab-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4286230367a47943ba644eb7fa2cdaff7e87e7697284c4be10aa33957a3df600 |
|
MD5 | fcf20611857be19816bfdc1e09825730 |
|
BLAKE2b-256 | 49f48f7187157b3c767648da85bbb478ac011cdcfebfd74f3b1e14901f0071fc |