experiment#

Scaffold a new experiment directory.

The mesofield init CLI command (see mesofield.cli.acquire) calls scaffold_experiment() to generate a working layout new lab users can run, edit, and extend without writing anything from scratch:

my-experiment/

experiment.json # session / protocol / duration hardware.yaml # device stanzas procedure.py # Procedure subclass (Python entry point) devices/

__init__.py thermal_example.py # annotated custom-device template

The hardware.yaml is supplied by the caller (mesofield init):

  • a Path to a canonical rig file -> copied in verbatim,

  • "dev" -> a mock config (MockEncoderDevice) that runs out of the box on any machine,

  • "blank" -> a commented real-hardware template to fill out.

mesofield.scaffold.experiment.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.experiment.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