What is an experiment?
An experiment is the top tier of the PLESTY pipeline. It connects to one or more device TCP servers and an optional analyzer, then defines the measurement sequence that produces scientific results.
Experiments:
- Use
CompositeDeviceto hold multiple device clients under named attributes - Define measurement functions (e.g.,
wavelength_sweep,power_stability_test) - Return structured, typed results
- Do not run as TCP servers themselves — they are the client side of the pipeline
Scaffolding
mkdir plesty-scan-exp && cd plesty-scan-exp
plesty init experiment --name scan_exp
The scaffold generates the same project layout as a device project, but without base_device.py and with module_type = "experiment" in pyproject.toml. Gate d1 does not apply to experiments.
Steps
- CompositeDevice pattern — group multiple device clients
- Measurement functions — implement the measurement workflow
- Testing without hardware — mock device clients in tests
pyproject.toml for experiments
[tool.plesty]
standard = "quantum"
module_type = "experiment"
[project]
dependencies = [
"plesty-lib>=0.2,<1",
"plesty-power-meter>=0.1,<1", # optional: type-check device usage
]