Add Intan RHD2000 file header reader#17
Merged
stevevanhooser merged 3 commits intomainfrom Mar 16, 2026
Merged
Conversation
Make vhlab-toolbox-python pip-installable by adding pyproject.toml with setuptools build backend and proper dependencies (numpy, pandas, scipy, h5py). Port read_Intan_RHD2000_header from MATLAB to vlt/hardware/intan.py, supporting both v1.x (60 samples/block) and v2.x (128 samples/block) RHD files. The function reads binary headers including magic number verification, sample rate, frequency parameters, channel definitions, and computes num_samples from file size. Add comprehensive tests with synthetic .rhd file generation covering header reading, t0/t1 computation, channel info, frequency parameters, invalid files, version 2 format, and header-only files. https://claude.ai/code/session_01AQ3fUwbRvMsTS2pyJpQXRk
Ignore setuptools egg-info build artifacts generated by pip install -e. https://claude.ai/code/session_01AQ3fUwbRvMsTS2pyJpQXRk
Add GitHub Actions CI workflow with: - Lint job using ruff with rules configured to pass on existing codebase - Test job with matrix strategy for Python 3.10, 3.11, and 3.12 Also add matplotlib to dependencies, pytest as optional test dependency, and configure pytest importlib mode to resolve test name collisions. https://claude.ai/code/session_01AQ3fUwbRvMsTS2pyJpQXRk
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
This PR adds support for reading Intan RHD2000 file headers, porting the MATLAB implementation to Python. It includes a complete header parser and comprehensive test coverage.
Key Changes
New module
vlt/hardware/intan.py: Implementsread_Intan_RHD2000_header()function that parses RHD2000 binary file headersComprehensive test suite
tests/vlt/hardware/test_intan.py:Project configuration:
pyproject.tomlwith package metadata and dependencies.gitignoreto exclude egg-info directoriesImplementation Details
https://claude.ai/code/session_01AQ3fUwbRvMsTS2pyJpQXRk