Metadata-Version: 2.4
Name: matterlab_mfcs
Version: 0.1.0
Summary: Python APIs for mass flow controllers used in the Matter Lab.
Author: Han Hao
License-Expression: MIT
Keywords: alicat,massflowcontroller,automation,matterlab
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: System :: Hardware
Classifier: Topic :: System :: Hardware :: Hardware Drivers
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: matterlab_serial_device
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-timeout; extra == "dev"
Requires-Dist: ruff; extra == "dev"

# Matter Lab Mass Flow Controllers

`matterlab_mfcs` provides Python drivers for mass flow controllers used in Matter Lab automation workflows.

The first supported device family is Alicat instruments using the Modbus RTU manual bundled with this workspace.

## Installation

Use the `matterlab` conda environment and install the package in editable mode during development:

```bash
pip install -e .[dev]
```

The package depends on `matterlab_serial_device` for serial communication.

## Quick Start

```python
from matterlab_mfcs import AlicatMFC

mfc = AlicatMFC(com_port="COM5", address=1)
print(mfc.firmware_version)
print(mfc.serial_number)
print(mfc.pressure)
print(mfc.temperature)
```

## Testing

Unit tests are the default:

```bash
pytest
```

Real hardware validation is opt-in:

```bash
pytest tests/test_alicat_mfc_real.py --run-real --com-port COM5 --address 1
```

## Notes

- Source code lives under `src/`
- Pytest uses `src` as the import root
- Real hardware tests are skipped unless explicitly enabled
- The Alicat Modbus CRC implementation matches the Modbus RTU framing validated against the local device on `COM5`
- Multi-read snapshots should live in scripts or tests, not inside the driver
