Skip to main content

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 class
  • IKAHotplate
  • HeidolphHotplate
  • IKAHBHotbath

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:

  • temp
  • target_temp
  • rpm
  • target_rpm
  • stand_by()

Device-specific classes add their own helpers:

  • IKAHotplate: reset(), tare(), weight
  • HeidolphHotplate: _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.py
  • tests/test_heidolph_real.py
  • tests/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 runner
  • examples/real_devices.py: readable examples for real IKA, Heidolph, and hotbath hardware
  • examples/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

matterlab_hotplates-1.1.1.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matterlab_hotplates-1.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file matterlab_hotplates-1.1.1.tar.gz.

File metadata

  • Download URL: matterlab_hotplates-1.1.1.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for matterlab_hotplates-1.1.1.tar.gz
Algorithm Hash digest
SHA256 a6b79a9bad4a16fa3d416d633446811b98584f2e33a05fbfea292bc537274e10
MD5 8589fbea17725223a38837039f47f374
BLAKE2b-256 d9579edf2cb9918fee9c6dcfe789a0eb7ea30351ea1a380e47df4d17140ece80

See more details on using hashes here.

File details

Details for the file matterlab_hotplates-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for matterlab_hotplates-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10302cceabd7eab2d181edf2046e776d96911b53896b8b685a119fe3e0f79767
MD5 32fecb9e42b6e9ab4f8a3ab805f3eb4e
BLAKE2b-256 8da2a19773065147575ef649cb6bda3cb84a419cb80a6d4478f0d1b22dd9e904

See more details on using hashes here.

Supported by

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