A Python API for the hotplates in the Matter Lab.
Project description
matterlab_hotplates
matterlab_hotplates provides serial drivers for the heat-stir devices used in the Matter Lab. The package wraps device-specific command sets behind a small common interface so automation code can read temperatures, set heating targets, and control stirring without dealing with raw serial commands.
Supported Devices
HeatStirPlate: shared abstract base classIKAHotplateHeidolphHotplateIKAHBHotbath
Installation
Install the package:
pip install matterlab_hotplates
For development:
pip install -e .[dev]
The package depends on matterlab_serial_device, which is installed automatically.
Quick Start
Example with an IKA hotplate:
from matterlab_hotplates import IKAHotplate
hotplate = IKAHotplate(com_port="COM5")
print("Current temperature:", hotplate.temp)
print("Current stirring speed:", hotplate.rpm)
hotplate.temp = 80
hotplate.rpm = 400
hotplate.stand_by()
Core API
The shared HeatStirPlate interface exposes:
temptarget_temprpmtarget_rpmstand_by()
Device-specific classes add their own helpers:
IKAHotplate:reset(),tare(),weightHeidolphHotplate:_set_new_interface_protocol()IKAHBHotbath:name,maxtemp
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_heat_stir_plate.py tests/test_ika_sim.py tests/test_heidolph_sim.py tests/test_ika_hotbath_sim.py
Hardware Tests
Hardware tests are opt-in because real devices may not be connected in every environment.
Available hardware test files:
tests/test_ika_real.pytests/test_heidolph_real.pytests/test_ika_hotbath_real.py
They are marked with @pytest.mark.real and are skipped unless --run-real is supplied.
Example:
pytest tests/test_ika_real.py --run-real --com-port COM5
You can also provide hardware configuration through an environment variable:
HOTPLATE_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 IKA, Heidolph, and hotbath 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_hotplates/
base_hotplate.py
heidolph_hotplate.py
ika_hotbath.py
ika_hotplate.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_hotplates-1.0.6.1.tar.gz.
File metadata
- Download URL: matterlab_hotplates-1.0.6.1.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4fbecd0fbbb2568cca1e3470e4fc1fab4e3062476716e1cbfbb32dcba0920c5
|
|
| MD5 |
960185975e59bd5d5f56c9efccfc7c32
|
|
| BLAKE2b-256 |
d72a7a1cc86887ebd021f855bbb0d1121cc1f64906ceb7f52ac2fa37a4f52f97
|
File details
Details for the file matterlab_hotplates-1.0.6.1-py3-none-any.whl.
File metadata
- Download URL: matterlab_hotplates-1.0.6.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a594625448559af75b74dac4b17cdb3dc570245899b24a580dd26591de4b5f9a
|
|
| MD5 |
3be63405494e551039a21162c90b4095
|
|
| BLAKE2b-256 |
677b257b2c0f8f12fb1115c6ebb1d0b4de80f048abb90ce55c110ed8da2cde22
|