scaffold#
Scaffolding for new experiments and machine-level rig configurations.
Both halves are “get a machine/experiment ready to use” concerns:
scaffold_experiment()generates a runnable experiment directory.mesofield.scaffold.rigskeeps a per-machine store of canonicalhardware.yamlfiles thatmesofield initcopies into new experiments.
- mesofield.scaffold.scaffold_experiment(target, *, name=None, force=False, hardware='blank')[source]#
Generate a runnable experiment layout at target. Returns the dir.
hardwareselects thehardware.yamlwritten into the experiment: aPath(copied verbatim from a canonical rig file),"dev"(mock config), or"blank"(fill-out template).
- mesofield.scaffold.hardware_yaml_template()[source]#
A commented real-hardware skeleton that must be filled out before use.
Used both for
mesofield initwith theblankchoice and formesofield rig new(a fresh canonical rig file to edit).- Return type:
- mesofield.scaffold.rigs_dir()[source]#
Return (creating if needed) the directory holding canonical rig files.
- Return type:
- mesofield.scaffold.rig_devices(name)[source]#
Return
(device_name, device_type)pairs declared by rigname.Mirrors how
HardwareManagerreads the YAML: every top-level mapping (other than scalar config keys) is a device, and acameras:list expands to one entry per camera.
- mesofield.scaffold.add_rig(name, source, *, force=False)[source]#
Copy an existing
hardware.yamlinto the store undername.The source is parsed with
yaml.safe_load()first so a malformed file is rejected before it lands in the store.
- mesofield.scaffold.new_rig(name, *, force=False)[source]#
Write a blank fill-out hardware template into the store under
name.
- mesofield.scaffold.remove_rig(name)[source]#
Delete a rig from the store.
- Parameters:
name (str)
- Return type:
None