This guide is for the Equipment Integrator persona - developers who create modules to integrate laboratory instruments with MADSci.
Guide Contents¶
Understanding Modules - Node vs Module vs Interface concepts
Creating a Module -
madsci new modulewalkthroughDeveloping Interfaces - Interface patterns and driver communication
Fake Interfaces - Creating testable simulated implementations
Wiring the Node - Connecting interface to node server
Testing Strategies - Unit, integration, and hardware-in-the-loop testing
Debugging - Common issues, logging, and troubleshooting
Packaging & Deployment - Docker, dependencies, and CI/CD
Publishing - Sharing modules and versioning
Who is an Equipment Integrator?¶
An Equipment Integrator:
Develops modules for laboratory instruments
Creates interfaces for hardware communication
Tests modules with and without physical hardware
Packages modules for deployment
Often, this is the same person who also operates the lab or runs experiments.
Quick Start¶
To create a new module:
madsci new module --name my_instrument
cd my_instrument_module
pip install -e .
python src/my_instrument_rest_node.pyKey Concepts¶
Module vs Node vs Interface¶
| Concept | Description | Files |
|---|---|---|
| Module | Complete package for an instrument | Entire repository |
| Node | Runtime REST server | *_rest_node.py |
| Interface | Hardware communication logic | *_interface.py |
The Development Workflow¶
1. Scaffold module → madsci new module
2. Develop interface → Hardware communication
3. Create fake → Simulated interface
4. Test interface → Jupyter/pytest
5. Wire up node → Connect to MADSci
6. Test node → Run with fake interface
7. Test with hardware → Switch to real interface
8. Package & deploy → Docker, CI/CDPrerequisites¶
Python 3.10+
Understanding of your target instrument’s communication protocol
Basic familiarity with MADSci concepts (see Tutorial 1)