Skip to content

Support integer/slice indexing on compound datasets#124

Open
bendichter wants to merge 1 commit intomainfrom
fix-compound-dataset-integer-indexing
Open

Support integer/slice indexing on compound datasets#124
bendichter wants to merge 1 commit intomainfrom
fix-compound-dataset-integer-indexing

Conversation

@bendichter
Copy link
Contributor

Summary

  • Fixes error opening icephys file #115 — icephys files failed to open via lindi because hdmf indexes compound datasets with integers (dataset[0]), which raised a TypeError
  • Added _get_compound_rows method to handle integer indexing (returns np.void) and slice indexing (returns structured numpy array), with proper reference decoding
  • Added tests for integer and slice indexing on compound datasets

Test plan

  • Verified fix with the icephys file from the issue (dandiset 001183)
  • Added unit tests for integer and slice indexing on compound datasets
  • All 43 existing tests pass

🤖 Generated with Claude Code

Fixes #115. Previously, indexing a compound dataset with anything other
than a field name string raised a TypeError. hdmf needs integer indexing
(dataset[0]) to check if a 1-element compound dataset is scalar, which
caused icephys files to fail when opened via lindi.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.74%. Comparing base (f48e993) to head (fccbdf6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
+ Coverage   81.63%   81.74%   +0.11%     
==========================================
  Files          30       30              
  Lines        2793     2805      +12     
==========================================
+ Hits         2280     2293      +13     
+ Misses        513      512       -1     

☔ 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.

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.

error opening icephys file

2 participants