Skip to content

Conversation

@samuelbray32
Copy link
Collaborator

Fixes #121

When making the list of hwChan as ordered in the binary stream, restrict to only channels included in the recording. This ensures proper indexing into the binary data

@samuelbray32 samuelbray32 requested a review from Copilot June 26, 2025 17:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that the list of hardware channels (hwChan) is filtered to only those included in the recording, preserving correct indexing into the binary data.

  • Extended _produce_ephys_channel_ids with parameters for recorded channel count and channel list, and added filtering logic.
  • Updated _parse_header to gather hw_channels_recorded from the XML and pass it into the channel ID generator.
  • Split the original numChannels attribute into num_chip_channels and num_ephy_channels, though both currently draw from the same source.
Comments suppressed due to low confidence (2)

src/trodes_to_nwb/spike_gadgets_raw_io.py:75

  • Update the docstring to reflect the new parameters n_channels_recorded and hw_channels_recorded for clarity.
    def _produce_ephys_channel_ids(

src/trodes_to_nwb/spike_gadgets_raw_io.py:187

  • num_chip_channels and num_ephy_channels are both assigned from the same XML attribute; verify if there is a distinct attribute for recorded channels to avoid misconfiguration.
        num_chip_channels = int(

@codecov
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.38%. Comparing base (73e14e6) to head (e0bb9e6).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #122      +/-   ##
==========================================
+ Coverage   89.32%   89.38%   +0.05%     
==========================================
  Files          12       12              
  Lines        1471     1479       +8     
==========================================
+ Hits         1314     1322       +8     
  Misses        157      157              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samuelbray32 samuelbray32 self-assigned this Jun 26, 2025
@samuelbray32 samuelbray32 requested a review from rly June 26, 2025 18:37
@rly
Copy link
Collaborator

rly commented Jun 26, 2025

I made some minor suggestions but otherwise looks good to me.

@samuelbray32 samuelbray32 merged commit 6145f12 into main Jun 26, 2025
7 checks passed
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.

Binary file indexing with un-recorded channels.

3 participants