A Python API for the shakers in the Matter Lab.
Project description
matterlab_shakers
matterlab_shakers provides serial drivers for the shakers used in the Matter Lab. It includes a shared shaker interface and a driver for Torrey Pines temperature-controlled shakers.
Supported Devices
Shaker: shared abstract base classTorreyPinesShaker
Installation
Install the package:
pip install matterlab_shakers
For development:
pip install -e .[dev]
The package depends on matterlab_serial_device.
Quick Start
from matterlab_shakers import TorreyPinesShaker
shaker = TorreyPinesShaker(com_port="COM5")
print("Current temperature:", shaker.temp)
print("Current speed level:", shaker.speed)
shaker.temp = 40
shaker.speed = 3
shaker.idle = True
Core API
The shared Shaker interface exposes:
temptarget_tempspeedidle
The Torrey Pines driver adds:
device_modelserial_numberconnect()error_reporting(...)
Testing
Simulation Tests
Simulation tests are the default validation layer and are safe for CI.
One-click run:
python examples/test_sim.py
Direct pytest run:
pytest tests/test_base_shaker.py tests/test_torrey_pines_sim.py
Hardware Tests
Hardware tests are opt-in because real shakers may not be connected in every environment.
Available hardware test files:
tests/test_torrey_pines_real.py
They are marked with @pytest.mark.real and are skipped unless --run-real is supplied.
Example:
pytest tests/test_torrey_pines_real.py --run-real --com-port COM5
You can also provide hardware configuration through an environment variable:
SHAKER_COM_PORT
Examples
The examples/ directory contains the recommended entry points:
examples/test_sim.py: one-click simulation-only test runnerexamples/real_devices.py: readable examples for real Torrey Pines hardwareexamples/README.md: short guide to the examples directory
Development
Useful commands:
pytest
ruff check .
ruff format .
The default pytest configuration includes retries, timeouts, coverage output, and uses src as the import root for local development.
Package Layout
src/matterlab_shakers/
base_shaker.py
torrey_pines_shakers.py
tests/
examples/
License
This project is distributed under the MIT License. See LICENSE for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matterlab_shakers-1.1.0.tar.gz.
File metadata
- Download URL: matterlab_shakers-1.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6de9fedcc36a514ccbb91d6e2a754a48ce611b994bec2b7834b6e486d4b87d04
|
|
| MD5 |
4a94ea51855b0dd11801dac3ae3fec4b
|
|
| BLAKE2b-256 |
5eee85cb3bc344534aaf81eb8881d1db938b099985d355215a622ce3981151e2
|
File details
Details for the file matterlab_shakers-1.1.0-py3-none-any.whl.
File metadata
- Download URL: matterlab_shakers-1.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b59d4d7e3a0143283838bcf49b75a1be299fd5ea8088052973073c1d053b64a
|
|
| MD5 |
822fd9868c85e8d228bcd305d7aa4548
|
|
| BLAKE2b-256 |
91b99763dc7ca229a06f8865c51ee4b0382e513631ae363daee219a7f705072d
|