Coen-Lab/lib-open-rigs is the Coen Lab's fork: its
mainis what every lab workflow runs. How the lab uses it is in claude-toolsdocs/architecture/COEN-LAB.md.
Repository for the open-rigs ecosystem: shared rig schemas (Python), Bonsai acquisition operators (.NET), and a Copier template used to scaffold new experiment repositories.
Full documentation, including tutorials and API reference, is published at https://open-rigs.github.io/open-rigs (deployed on release).
| Tool | Purpose |
|---|---|
| Git | Version control |
| .NET 8 SDK | Building the C# packages and the DocFX site |
Python 3.11+ with uv |
Python package, schema generation, tests |
| Bonsai | Optional, only needed to render workflow SVGs locally |
dotnet tool restore
dotnet docfx docs/docfx.json --serveDocFX will print a http://localhost:8080-style URL. Open it to preview the site.
To also render workflow images (requires Bonsai on Windows), run pwsh docs/build.ps1 instead.
A workflow builds its rig from device pieces, one include per device instance (Building Blocks).
- A new rig of devices the lab already has: give the rig its
rig.ymlwith an entry per device, then in its workflow includeReadLabRig(setConfigRoot),ReadyGate, one clock (ClockFromTimestampGeneratororClockFromBoard), one piece per device with itsNameset,CameraTriggersif it has a camera,SpeakerMixerif it has a speaker array andProjectorDisplayif it has a projector. SetPieceStagesto the stages the pieces announce (SpeakerMixerannouncesMixerStarted). Runscripts\check-workflow.ps1(-Workflow <file>for one other thanmain.bonsai) and the workflow's tests:workflow_lint.hardware_problemsnames anything missing or misnamed. No new hardware code. When a second task runs on the same rig kind, move its pieces into a rig list include besideDomeHardware, and add it toRIG_LISTSandSIGNATURESinworkflow_lint.py. - A new kind of device: add its part to the rig model (
src/open_rigs/components/, thenuv run regenerate-lab-rig), and write its piece inOpenRigs.Devices: one externalisedNamemapped toRigDevice, itsAsyncSubjectand its log (LogHarpDevicefor a Harp device),CommandsSubjectNameandDataSubjectNamedefaulting empty orUNMAPPED(never a real subject's name), a refusal at Start naming what is missing, and anAnnounceStageintoReadyStagesif a task must wait for it. Teachworkflow_lintits file and subjects, and add it to the acceptance fixture intests/rigs/test_workflow_lint.py.
uv sync
uv run pytestopen_rigs.zapit (src/open_rigs/zapit/, the zapit extra) is LGPL-2.1-only, upstream Zapit's terms; the rest is BSD-3-Clause. See THIRD-PARTY-NOTICES.md.