Repository navigation
compress_ephys: pass the data format (unsigned, 8/32/64-bit, float) - #4
Conversation
compress_ephys(data, fullfilename, output_size_bits=, data_is_unsigned=, data_format=) writes the format keys that ndi_compress_ephys reads since Waltham-Data-Science/NDI-compress#14, matching MATLAB's ndi.compress.compress_ephys. Integer arrays keep their dtype (signedness and size); data_format='float' stores 64-bit floats. Non-integer input with no data_format is still converted to int16. The written header is checked: a binary that predates the format keys stores signed int16 regardless, and compress_ephys now raises rather than leaving wrong data. The Linux ndi_compress_ephys is rebuilt from NDI-compress#14. The macOS and Windows binaries still need copying from that PR's build artifacts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
|
The old binary:
Fix: replace Generated by Claude Code |
The executables in src/ndicompress/bin were copied in by hand, so they go stale whenever NDI-compress changes (as with NDI-compress#14). The new build-binaries workflow builds them on Linux (ubuntu-22.04), macOS (universal) and Windows from the NDI-compress commit named in ndi-compress-ref.txt (or given when it is run by hand), runs this package's tests with them on each platform, and commits them to the branch it ran on. Changing ndi-compress-ref.txt triggers it. ndi-compress-ref.txt starts at 650b308, NDI-compress main with #14, so this push builds the macOS and Windows binaries this PR needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
…KEN secret The workflow's own GITHUB_TOKEN can read only this repository, so the checkout of NDI-compress failed with 'Repository not found'. The NDI-compress checkout and ls-remote now use the repository secret NDI_COMPRESS_TOKEN, and the run stops with an explanation when it is not set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
Only the commit job gets contents: write; the build jobs, which run third-party code and the NDI-compress build, are read-only. Every action is pinned to a commit, since what runs here ends up in the executables every NDI-python install runs. The NDI-compress checkout does not keep its token in git config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
|
The fix is now in this PR as the Blocker: the repository secret Generated by Claude Code |
A deploy key does not expire, belongs to no person, and can read only NDI-compress, where a personal access token is tied to someone's account and (fine-grained) expires. The private key is the secret NDI_COMPRESS_DEPLOY_KEY. The resolve job now checks NDI-compress out at the requested ref and takes its HEAD, which works for a branch, tag or commit and needs no token in a URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
Changing ndi-compress-ref.txt starts build-binaries, which now has the NDI_COMPRESS_DEPLOY_KEY secret. The workflow resolves main to its commit and writes that back to the file with the binaries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
… workflow changes The NDI tools unpack with tar. The build job's bash shell on Windows is Git Bash, whose GNU tar reads 'C:\...' as a remote host, so every expand test failed although the binaries were fine. Users (and test.yml) run them where Windows' own tar is found, so the Windows test step now uses pwsh. A change to this workflow now also triggers a rebuild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
Built and tested on Linux, macOS and Windows by the build-binaries workflow (run 41204651693).
A commit pushed by build-binaries starts no other workflow, so the tests could not be run on it without another push. Test NDI Compress can now be run on any branch from the Actions tab; the README says when. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
Why
NDI-python's ingest needs to store data the way NDI-matlab does. For example, Intan amplifier and aux samples are stored as unsigned 16-bit integers. The encoder learned this in Waltham-Data-Science/NDI-compress#14 (merged). This PR brings the matching wrapper change, the rebuilt binaries, and a way to keep the bundled binaries in step with NDI-compress.
What
compress_ephys(data, fullfilename, *, output_size_bits=None, data_is_unsigned=None, data_format=None), mirroring MATLAB'sndi.compress.compress_ephys:data_format='float'stores 64-bit floats;data_formatis still converted to int16, as before.ndi_compress_ephysbuilt before NDI-compress#14 ignores the format keys and silently stores signed int16. Legacy int16 calls still work with old binaries.build-binariesworkflow: builds the tools from NDI-compress on Linux (ubuntu-22.04), macOS (universal) and Windows. It runs this package's tests with them on each platform, then commits them intosrc/ndicompress/bin/on the branch it ran on.ndi-compress-ref.txt.main, it can also be run from the Actions tab.NDI_COMPRESS_DEPLOY_KEY). The key doesn't expire, isn't tied to anyone's account, and can read only NDI-compress.tar, as users' setups do.test.ymlcan also be run by hand (workflow_dispatch). A commit made bybuild-binariesstarts no other workflow, so after a rebuild, run "Test NDI Compress" on the branch.Testing
build-binariesrun 3 passed:Generated by Claude Code