Skip to content

add synthetic data source for running without trodes#10

Open
jl33-ai wants to merge 1 commit into
LorenFrankLab:mainfrom
jl33-ai:add-synthetic-data-source
Open

add synthetic data source for running without trodes#10
jl33-ai wants to merge 1 commit into
LorenFrankLab:mainfrom
jl33-ai:add-synthetic-data-source

Conversation

@jl33-ai
Copy link
Copy Markdown

@jl33-ai jl33-ai commented May 29, 2026

right now the only way to run the pipeline is against a live Trodes acquisition. that gate makes a few useful things harder than they need to be:

  • smoke testing a fresh install (does pip install actually work end to end?)
  • developing or debugging the decoder loop on a laptop
  • CI / regression tests
  • letting outside contributors poke at the codebase before they have a rig stood up

this PR adds an in-process synthetic data source so the whole MPI pipeline can run without any hardware.

  • realtime_decoder/synthetic.py
    • SyntheticDataReceiver is a drop-in for TrodesDataReceiver. emits poisson spikes per ntrode, white-ish LFP, and a triangle-wave position walk along a single linear segment. non-blocking __next__ semantics so the polling main loops in encoder/decoder/ripple work unchanged.
    • SyntheticClient is a drop-in for TrodesClient. same surface used by the supervisor and stim decider. fires startup/termination callbacks on wall-clock timers and records would-be ECU shortcut messages instead of sending them.
  • runscript.py picks the data source via config['datasource'] ('trodes' default, 'synthetic' new) using a small factory. no change for existing configs.
  • config/demo_synthetic.yml is a 5 rank demo wired to the synthetic source (1 supervisor, 1 ripples, 1 encoder, 1 decoder, 1 gui). output to /tmp, no hardware paths, auto-terminates after 30s.
  • README.md adds a 'running without acquisition hardware' section so the install-and-try path is discoverable.

caveat: not biologically realistic. spikes are poisson, marks gaussian, the synthetic animal walks back and forth on one segment. the point is to exercise the plumbing, not to validate decoding accuracy. the stim decider's ECU shortcut messages become no-ops in synthetic mode, which is intentional for a demo.

to try it:

mpiexec -np 5 python -u runscript.py config/demo_synthetic.yml

lets you run the pipeline end to end without an acquisition rig. useful for smoke testing a fresh install, working on a laptop, and CI.

- realtime_decoder/synthetic.py: SyntheticDataReceiver and SyntheticClient that match the surface of TrodesDataReceiver and TrodesClient. drop in replacements. non-blocking __next__ semantics so the polling loops in encoder/decoder/ripple work unchanged.
- runscript.py picks the data source via config['datasource']. defaults to 'trodes' so every existing config keeps working.
- config/demo_synthetic.yml is a 5 rank demo wired to the synthetic source.
- README adds a 'running without acquisition hardware' section.

spikes are poisson, marks gaussian, position walks a triangle wave along a single segment. not biologically realistic, the point is to exercise the data path and message plumbing.

to try it:
  mpiexec -np 5 python -u runscript.py config/demo_synthetic.yml
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