worlds/<id>/live_state.yaml
Run-time state stored beside a world: tip pointers, seats and per-seat calibration.
A saved world is a snapshot of where things are. Things that change while workflows run, such as the next tip in a tip box, live in live_state.yaml in the same world folder, keyed by instance id. The file is optional.
Skills read and write it through two calls:
from .modules import get_world_state, set_world_state
state = get_world_state(tipbox_id) # {} when the object has no entry
set_world_state(tipbox_id, {"tip_index": 12}) # shallow merge, then written to diskset_world_state merges top-level keys; a nested map that you pass (for example a whole calibration table) replaces the stored one. Both calls use the live_state.yaml of the world that was loaded last. Calling them before any world is loaded fails with live_state: no world loaded.
Example
version: 2
objects:
wellplate_stand_1: # a holder: its seats, and per seat the types that may sit there
name: wellplate_stand_1
type: wellplate_stand
seats:
top_center:
wellplate_96_flatbottom: {} # accepted here, nothing stored yet
tipbox_holder_fixture_plate_1:
seats:
top_center:
tipbox_10ul: {tip_index: 12, active: true}Structure
| Key | Description |
|---|---|
version | Write 2 for seat-keyed files. A file without version is read as version 1, which keeps every key on the object entry. |
objects.<id> | One entry per instance id of the world. |
objects.<id>.seats.<anchor>.<type> | Declares a seat: the holder's anchor <anchor> accepts objects of <type>. The map under the type holds what belongs to "a <type> on this seat": calibration tables and the run-time state of a unit that stays on the seat, such as a tip box's tip_index and active. {} means accepted, nothing stored yet. |
For an object seated on a holder, calibration values and a tip box's tip_index and active are stored in the bucket of its seat and type on the holder; other keys stay on the object's own entry. Swapping the object on a seat keeps each type's calibration; the run-time state (tip_index, active) starts over for the new unit.
Seats in the app
The Deck dialog in the Workflow Editor and the Skills Editor lists the seats this file declares and what sits on each, and lets you swap, place or remove the occupant. An edit there seats the object's bottom_center anchor on the seat anchor, writes the loaded world and commits it to the cloud project. Deck edits need a world saved from the World Builder; a starting layout is read-only.
Saving and copying
- Save as new in the World Builder copies the loaded world's
live_state.yamlinto the new folder when the new folder has none. The save message then says that tip counts and calibration were carried over. - Removing an object from the scene removes its entry.
- The file is ordinary YAML. An instance or box that already has a copy keeps its own when the project is reloaded, so a hand edit you sync does not replace it there; Save World writes the instance's copy back to the project.
See also
Updated 9 days ago