Fix numpy array conversion for LindiH5pyDataset#121
Merged
Conversation
Override __array__ and _is_empty on LindiH5pyDataset to prevent h5py's inherited methods from calling self.id.get_space(), which fails because id is a string in lindi's implementation. Fixes #120 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #121 +/- ##
==========================================
+ Coverage 81.39% 81.63% +0.23%
==========================================
Files 30 30
Lines 2784 2793 +9
==========================================
+ Hits 2266 2280 +14
+ Misses 518 513 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rly
reviewed
Mar 8, 2026
Contributor
|
@bendichter Can you also update this to support datasets with a compound dtype? edit: I believe |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Addressed review feedback - added |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
__array__and_is_emptyonLindiH5pyDatasetto prevent h5py's inherited methods from callingself.id.get_space(), which fails becauseidis a string in lindi's implementationnp.asarray,np.atleast_2d)Fixes #120
Test plan
test_numpy_array_conversionpasses🤖 Generated with Claude Code