Skip to content

feat(hardware): sim stand-ins for pulsepal and stage devices - #75

Merged
larsrollik merged 1 commit into
mainfrom
feat/sim-device-factories
Aug 14, 2026
Merged

feat(hardware): sim stand-ins for pulsepal and stage devices#75
larsrollik merged 1 commit into
mainfrom
feat/sim-device-factories

Conversation

@larsrollik

Copy link
Copy Markdown
Member

What

Completes Cycle D Step 2 — a hardware-free stand-in for every device type in the collection, so a task that declares required_devices: [..., pulsepal] or [..., stage] receives the same DeviceCollection under --simulate as on hardware, without touching serial ports.

  • SimPulsePal + SimStage stubs, and a simulate mode on PulsePalDevice/StageDevice (mirrors the existing bpod/scale pattern: preflight no-op, sim handle from _open, no-op _close).
  • Registered in _SIM_DEVICE_REGISTRY (pulsepal, stage_tower) — previously omitted, which forced migrated tasks to special-case --simulate.
  • SimPulsePal covers exactly the surface Stimulation touches (all programming/control calls no-op; channel_configs/nr_output_channels return real values).

Why

Cycle D migrates tasks to read hardware from the injected collection. Without a sim stand-in, a migrated task's --simulate path either got None (and had to special-case it) or fell back to opening real hardware. This closes that gap and unblocks the optotagging (pulsepal) migration.

Verification

  • New test_sim_devices.py (4 tests): registry coverage, sim stage/pulsepal preflight-noop + homing/programming, and the key integration — Stimulation connects + configures through SimPulsePal with no PulsePal attached.
  • Updated test_device_build for the new sim-collection membership. Device/execute/evaluate suite green (50 passed).

Adds SimPulsePal + SimStage and a simulate mode on PulsePalDevice/StageDevice
(mirroring the bpod/scale sim pattern: preflight no-op, sim handle from _open),
and registers them in _SIM_DEVICE_REGISTRY. A task that requires pulsepal or a
stage now receives the same device collection under --simulate as on hardware,
hardware-free - completing Cycle D Step 2. SimPulsePal covers exactly the
surface Stimulation touches (verified: Stimulation connects + configures through
it without a PulsePal attached).
@larsrollik
larsrollik requested a review from a team as a code owner August 14, 2026 06:38
@larsrollik
larsrollik merged commit 8235fdf into main Aug 14, 2026
7 checks passed
@larsrollik
larsrollik deleted the feat/sim-device-factories branch August 14, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant