scaffold#

Scaffolding for new experiments and machine-level rig configurations.

Both halves are “get a machine/experiment ready to use” concerns:

mesofield.scaffold.scaffold_experiment(target, *, name=None, force=False, hardware='blank')[source]#

Generate a runnable experiment layout at target. Returns the dir.

hardware selects the hardware.yaml written into the experiment: a Path (copied verbatim from a canonical rig file), "dev" (mock config), or "blank" (fill-out template).

Parameters:
Return type:

Path

mesofield.scaffold.hardware_yaml_template()[source]#

A commented real-hardware skeleton that must be filled out before use.

Used both for mesofield init with the blank choice and for mesofield rig new (a fresh canonical rig file to edit).

Return type:

str

mesofield.scaffold.rigs_dir()[source]#

Return (creating if needed) the directory holding canonical rig files.

Return type:

Path

mesofield.scaffold.list_rigs()[source]#

Return the sorted names of every rig in the store.

Return type:

list[str]

mesofield.scaffold.rig_path(name)[source]#

Return the path a rig named name resolves to (.yaml).

Parameters:

name (str)

Return type:

Path

mesofield.scaffold.rig_devices(name)[source]#

Return (device_name, device_type) pairs declared by rig name.

Mirrors how HardwareManager reads the YAML: every top-level mapping (other than scalar config keys) is a device, and a cameras: list expands to one entry per camera.

Parameters:

name (str)

Return type:

list[tuple[str, str]]

mesofield.scaffold.add_rig(name, source, *, force=False)[source]#

Copy an existing hardware.yaml into the store under name.

The source is parsed with yaml.safe_load() first so a malformed file is rejected before it lands in the store.

Parameters:
Return type:

Path

mesofield.scaffold.new_rig(name, *, force=False)[source]#

Write a blank fill-out hardware template into the store under name.

Parameters:
Return type:

Path

mesofield.scaffold.remove_rig(name)[source]#

Delete a rig from the store.

Parameters:

name (str)

Return type:

None

Submodules#