Repository navigation
Port Intan "one file per signal type" support from NDR-matlab - #29
Merged
Merged
Conversation
Mirrors NDR-matlab #138 (merge b461bf6): NDR-python previously only handled the "one file per channel" Intan directory layout (amp-A-000.dat, aux-A-AUX1.dat, ...). Some Intan recordings — including the KJNielsen lab's output that surfaced the sibling bug in vhlab-toolbox — save in the alternative "one file per signal type" layout, where all channels of a given signal type share one interleaved file (amplifier.dat, auxiliary.dat, supply.dat, analogin.dat, digitalin.dat, digitalout.dat). Add ndr.format.intan.read_IntanRHD2000_one_file_per_channel_type (regular_port, matching MATLAB semantics 1-for-1) and teach read_Intan_RHD2000_directory to detect the layout from a *amplifier.dat probe and dispatch to the new helper on hit. Resolve prefixed info.rhd and time.dat (e.g., "febc0_u000_000_info.rhd") through a local fixdatfilename helper. For digital channels in per-signal-type mode, extract the requested channel's bit from the packed 16-bit word using its native_order. ndr.reader.intan_rhd.filenamefromepochfiles now recognizes "<prefix>_info.rhd" as the directory-mode header when a *time.dat sibling is in the epoch file list. Bump matlab_last_sync_hash to b461bf6 on the three affected entries and add a bridge entry for the new function; all pass NDR_BRIDGE_CHECK_STRICT. 9 new unit tests mirror the MATLAB TestOneFilePerSignalType suite. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N2wVrGvkW9xWFGcoP8ed4k
stevevanhooser
deleted the
claude/intan-rhd2000-filename-error-onkw20
branch
September 10, 2026 17:57
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 NDR-matlab#138 (merge
b461bf6). NDR-python previously only handled the Intan "one file per channel" directory layout (amp-A-000.dat,aux-A-AUX1.dat, …). Some recordings — including the KJNielsen lab's Intan output that surfaced the sibling bug in vhlab-toolbox — save in the alternative "one file per signal type" layout: all channels of a given signal type share one interleaved file (amplifier.dat,auxiliary.dat,supply.dat,analogin.dat,digitalin.dat,digitalout.dat).Changes
ndr.format.intan.read_IntanRHD2000_one_file_per_channel_type(regular_port, 1-for-1 with the MATLAB helper) reads one interleaved signal-type file at a time, with the correct Intan filenames.read_Intan_RHD2000_directory:*amplifier.datprobe and dispatches to the new helper on hit; keeps the existing per-channel path otherwise.info.rhdandtime.dat(e.g.febc0_u000_000_info.rhd) via a local_fixdatfilenamehelper.native_order.ndr.reader.intan_rhd.filenamefromepochfilesrecognizes<prefix>_info.rhdas the directory-mode header when a*time.datsibling is in the epoch file list.Bridge
Bumps
matlab_last_sync_hashtob461bf6on the three affected entries (read_Intan_RHD2000_directory,reader.intan_rhd, and the new helper's own entry).NDR_BRIDGE_CHECK_STRICT=1bridge checks pass (191 tests).Tests
Adds
tests/test_intan_one_file_per_signal_type.py— 9 tests mirroring the MATLABTestOneFilePerSignalTypesuite: interleaved multi-channel amplifier reads, anauxiliary.datregression pin against the oldauxin.dat,time.dat, digital in/out returning the packed 16-bit word, sub-range slicing, prefix resolution, missing-file error, an end-to-endread_Intan_RHD2000_directorydispatch with a synthetic header, and prefixed-info.rhddirectory detection. All pass locally.Test plan
pytest tests/test_intan_one_file_per_signal_type.pyNDR_BRIDGE_CHECK_STRICT=1 NDR_MATLAB_PATH=../NDR-matlab pytest tests/test_matlab_bridge_completeness.py tests/test_matlab_bridge_conventions.pypytest tests/test_intan_multifile.py tests/test_readers.py).🤖 Generated with Claude Code
https://claude.ai/code/session_01N2wVrGvkW9xWFGcoP8ed4k
Generated by Claude Code