plesty-sdk#17 turns "use the shared data layer" into "don't fork it": three static checks — Gate 4, d2 and e2 — that keep every HUB module speaking the same plesty-lib schemas. Here's what that means when you use plesty, and what you do to keep a module you build green.
Every device's status(), every experiment's results, and every analyzer's input now resolve through one plesty-lib definition — so a value read from one module means the same thing in another. A module can no longer quietly ship its own DeviceStatus or dump loose .npy files that only look compatible: that fails CI now, instead of surfacing as an unresolvable mismatch at runtime while you're taking data.
Nothing to configure — pick any HUB module tagged with the current standard and its data lines up with the rest of your experiment by construction.
The checks run inside plesty check (and in CI), so you find out at your desk, not in review. To pass:
- Consume plesty-lib schemas — don't redefine them. Import
DeviceStatus, the config / op-schema / telemetry models,ResultDocumentand the scheduling models from plesty-lib rather than declaring a class of the same name in your package. - Persist through the data layer. Write results with
plesty.lib.data.save_resultinstead ofnp.save,pickle.dump,h5pyor a rawopen(…, "w")inside your module. - Keep the annotations. If you override
status()keep it-> DeviceStatus; overridedevice_state()keep it-> str— that's what lets telemetry consumers rely on your module.
status() must stay annotated -> DeviceStatus and device_state() must stay -> str, so telemetry consumers can rely on the plesty-lib schema.plesty.lib.data.save_result. Direct writes — np.save/savez, pickle.dump, h5py.File(…, write), builtin open(…, write) — inside the package are rejected.Experiment gate naming was normalised to lowercase (e1/e2) to match d1/d2.
Gate 4 guards a fixed set of plesty-lib names — the models and systems every HUB module consumes rather than redefines:
The reference modules — plesty-pm100d, amc300, pl-image-scan and plesty-lib itself — all pass, including with module_type declared, so you can copy their layout as a known-green starting point.