Plesty Demo Experiment#
Overview#
The reference PLESTY experiment: a mock line scan subclassing the async
Experiment ABC from plesty-lib. It runs without hardware — each plan step
simulates one measurement of a Gaussian signal profile — and demonstrates the
full lifecycle: deterministic build_plan(), async step operations returning
PlestyArray results, journaling, and checkpoint/resume.
Installation#
git clone https://gitlab.com/plesty/hub/experiments/demo.git
cd demo
uv sync
Usage#
uv run python -m plesty.demo_experiment --points 5
uv run python -m plesty.demo_experiment --resume <run_id> # continue an interrupted run
API reference#
PLESTY demo experiment: mock line scan showcasing the async Experiment ABC.
- class plesty.demo_experiment.DemoExperiment(devices: CompositeDevice | None = None, points: int = 5, amplitude: float = 1.0, noise: float = 0.05, run_root: str | Path = 'runs', **kwargs: object)#
Line scan over a simulated Gaussian signal profile.
The experiment “measures”
pointspositions along one axis. Each measurement is an atomic plan step that yields to the event loop (standing in for real device I/O) and returns a one-samplePlestyArraywith reproducible pseudo-noise.A
CompositeDevicemay be passed to demonstrate device composition — the default ofNonekeeps the demo runnable on any machine.- build_plan() Plan#
Return the deterministic scan schedule: one step per position.
- async measure_point(x: int) PlestyArray#
Simulate one measurement at scan position x.
- Parameters:
x – Scan position index in
[0, points).- Returns:
the Gaussian profile value at x plus reproducible noise (seeded by x, so re-runs are comparable).
- Return type:
A one-sample array