Repository navigation
Add vhneuropixelsGLX_nidq DAQ system; fix digital on-edges one sample early - #349
Merged
Merged
Conversation
…after Mirrors VH-Lab/NDI-matlab#1127. - ndi_common/daq_systems/vhlab/vhneuropixelsGLX_nidq.json: reads the SpikeGLX NI-DAQ stream (*.nidq.bin/.meta) with the NDR neuropixelsGLX reader, so NI-DAQ digital lines (XDn = di(n+1)) can be named in epochprobemap.txt, e.g. an opto fiber on XD4 as vhneuropixelsGLX_nidq:dimp5. A blank vhlab session now has ten DAQ systems (test_vhprairieview's count updated). - ndi_daq_reader_mfdaq._read_derived_events: dep/den/dimp/dimn 'on' edges were timed one sample early (np.where without the + 1 that MATLAB's 1 + find(...), the 'off' edges and the ingested read use). The dimn 'off' bug fixed in MATLAB was already correct here. - Tests for both; bridge decision_log and CHANGELOG entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5uyvdiE4Ex6Q7UkurQ
CI pairs this branch with NDI-matlab's same-named branch (VH-Lab/NDI-matlab#1127), where both files have moved: mfdaq.m by the dimn fix (d37bf16c7; this port's dimn was already right) and +ndi/+setup/ by a comment in vhlab.m only. Notes in each decision_log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5uyvdiE4Ex6Q7UkurQ
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.
Summary
Mirrors VH-Lab/NDI-matlab#1127. CI pairs this PR with that PR's branch, which has the same name.
New vhlab DAQ system
vhneuropixelsGLX_nidq.ndi_common/daq_systems/vhlab/vhneuropixelsGLX_nidq.jsonis identical to the MATLAB file. It reads the SpikeGLX NI-DAQ stream (*.nidq.bin/*.nidq.meta) with the NDRneuropixelsGLXreader. That lets you name NI-DAQ digital lines inepochprobemap.txt; for example, an optogenetic fiber on XD4 isvhneuropixelsGLX_nidq:dimp5(SpikeGLX XDn is channeldi(n+1)).vhneuropixelsGLXreads the IMEC.ap.bin, whose digital lines are the IMEC sync bits, so those lines weren't reachable before. A blank vhlab session now has ten DAQ systems.Digital-edge "on" events were one sample early. In
ndi_daq_reader_mfdaq._read_derived_events(the non-ingested read fordep,den,dimp,dimn), each on-edge wasnp.where(...)[0], which is the last sample before the transition. MATLAB's1 + find(...), this port's off-edges, and its ingested read all use the first sample after it. A line going high at 1.000 s at 1 kHz reported 0.999 s. This adds the missing1 +.The MATLAB PR also fixes
dimnnever returning its off-edges. This port'sdimnbranches were already correct, so there was nothing to port for that.Changes
src/ndi/ndi_common/daq_systems/vhlab/vhneuropixelsGLX_nidq.json: new.src/ndi/daq/mfdaq.py: the two on-edge lines in_read_derived_events.dfba35572, the head of the paired branch, each with adecision_lognote:mfdaq_reader(+ndi/+daq/+reader/mfdaq.m) was at5c5784c6a. The only commit since then is thedimnfix, which needed nothing here; the on-edge fix above is what this port changes.setup(+ndi/+setup/) was atfd7ddbf06. The only net change is a comment invhlab.m.tests/test_daq_derived_digital_events.py: new. Checksdep,den,dimpanddimnagainst a reader with pulses at 1.0–1.1 s and 3.0–3.1 s.dimpanddimnfail without the fix (0.999 instead of 1.0).tests/test_vhneuropixelsglx_nidq.py: new. The system loads with the NDRneuropixelsGLXreader, the epochdir navigator and the.nidqfile patterns.tests/test_vhprairieview.py: the blank-session count goes from 9 to 10.CHANGELOG.md: Added and Fixed entries.Merge order
Merge VH-Lab/NDI-matlab#1127 first, as a merge commit rather than a squash. The two bridge hashes point at
dfba35572, which exists only on the paired NDI-matlab branch until then. Once this PR is onmain, its CI falls back to NDI-matlabmain. Ifdfba35572isn't there, because the MATLAB PR hasn't merged or was squashed, the bridge-hash checks will fail.Testing
Run locally:
black --checkandruff checkpass.pytest tests/passes (5,547 tests). The cloud tests were left out because they need cloud credentials.tests/test_matlab_bridge_hashes.pypasses withNDI_BRIDGE_CHECK_STRICT=1against the paired NDI-matlab branch, as in CI.make_artifactsandread_artifactssuites pass, apart from two failures that fail the same way onmainhere: a blocked dataset download and the optionalpyabfpackage missing.🤖 Generated with Claude Code
https://claude.ai/code/session_011v7R5uyvdiE4Ex6Q7UkurQ