rigs#

Machine-level store of canonical hardware.yaml rig configurations.

A hardware.yaml is rig-specific – it pins COM ports, camera ids, device indices, and Micro-Manager .cfg paths to one physical computer. Rather than hand-copying the right file into every new experiment, each machine keeps a small store of named canonical configs in its OS-native config directory (via platformdirs). mesofield init copies a chosen rig into the new experiment so the experiment folder stays self-contained.

mesofield.scaffold.rigs.rigs_dir()[source]#

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

Return type:

Path

mesofield.scaffold.rigs.list_rigs()[source]#

Return the sorted names of every rig in the store.

Return type:

list[str]

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

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

Parameters:

name (str)

Return type:

Path

mesofield.scaffold.rigs.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.rigs.new_rig(name, *, force=False)[source]#

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

Parameters:
Return type:

Path

mesofield.scaffold.rigs.save_rig(name, doc, *, force=False)[source]#

Serialize a builder-assembled mapping into the store under name.

The single write path used by the GUI hardware builder. The mapping is dumped to YAML and re-parsed before it lands in the store, so a malformed document can never be saved as a canonical rig.

Parameters:
Return type:

Path

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

Delete a rig from the store.

Parameters:

name (str)

Return type:

None

mesofield.scaffold.rigs.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]]