feat(hardware): sim stand-ins for pulsepal and stage devices - #75
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sameDeviceCollectionunder--simulateas on hardware, without touching serial ports.SimPulsePal+SimStagestubs, and asimulatemode onPulsePalDevice/StageDevice(mirrors the existing bpod/scale pattern:preflightno-op, sim handle from_open, no-op_close)._SIM_DEVICE_REGISTRY(pulsepal,stage_tower) — previously omitted, which forced migrated tasks to special-case--simulate.SimPulsePalcovers exactly the surfaceStimulationtouches (all programming/control calls no-op;channel_configs/nr_output_channelsreturn real values).Why
Cycle D migrates tasks to read hardware from the injected collection. Without a sim stand-in, a migrated task's
--simulatepath either gotNone(and had to special-case it) or fell back to opening real hardware. This closes that gap and unblocks the optotagging (pulsepal) migration.Verification
test_sim_devices.py(4 tests): registry coverage, sim stage/pulsepal preflight-noop + homing/programming, and the key integration —Stimulationconnects + configures throughSimPulsePalwith no PulsePal attached.test_device_buildfor the new sim-collection membership. Device/execute/evaluate suite green (50 passed).