Working without Hardware (Mock Device)
Pyglaze ships with a built‑in mock device that produces synthetic data identical in shape and units to what you would receive from a physical Glaze device. This makes it possible to develop, unit‑test, or demonstrate software even when no hardware is connected.
Quick‑start To mock the asynchronous scanner, use
To use the synchronous scanner, use
1 When to use the mock device
Scenario | Benefit |
---|---|
Algorithm development | Iterate on processing pipelines without reserving lab time. |
Continuous integration | Run the full test‑suite on CI servers that have no USB access. |
Workshops & demos | Teach new users the API anywhere, even on a plane. |
Bug reports | Supply a minimal, reproducible script that others can run without hardware. |
2 How it works
- The sentinel string
"mock_device"
instructs Pyglaze to replace the serial driver with a software stub. - All higher‑level classes (
Scanner
,GlazeClient
,Pulse
,UnprocessedWaveform
, …) operate unchanged.
3 Common pitfalls
- Misspelling the sentinel – the string is case‑sensitive. Use exactly
"mock_device"
. - Mistaking it for a placeholder – it is the implementation, not an example to replace.
4 Search keywords
- simulate / simulation
- virtual device
- offline mode
- no hardware
- CI pipeline
- test without device