Repository navigation
[dev] Stream HDF5 files with datalad-fuse's remfile backend, without a custom cache - #1964
Closed
CodyCBakerPhD wants to merge 3 commits into
Closed
CodyCBakerPhD wants to merge 3 commits into
CodyCBakerPhD wants to merge 3 commits into
Conversation
…om cache Try moving the streaming of NWB files to the remfile backend of datalad-fuse (datalad/datalad-fuse#131), using the `remfile-dev` branch of CodyCBakerPhD/datalad-fuse (#131 plus `init_annex`): - The adapter is created with `backends="remfile,fsspec"`: remfile for HDF5-based files, fsspec for the others (and for HDF5-based files that remfile fails to open), and `init_annex=False`, so `annex_initialized()` is gone. - `_coalescing_block_cache()` and `_read_in_small_blocks()` are gone: remfile reads an NWB file's structure downloading a small part of it (0.6 of 16 MB in `test_annexed_readable_reads_little`, where fsspec's default cache downloads 64 MB). - Garbage collection is only paused while files read with fsspec are open. remfile fetches the data in the reading thread, so no finalizer can run in another thread while h5py holds its lock waiting for it. With fsspec that still deadlocks with a patched h5py, through `HDMFIO.__del__` calling `is_open()` in fsspec's I/O thread. - remfile is added to the `datalad` extra, and the `datalad-dev` CI job installs the `remfile-dev` branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## claude/datalad-fuse-remfile #1964 +/- ##
===============================================================
- Coverage 91.14% 91.12% -0.02%
===============================================================
Files 94 94
Lines 14866 14765 -101
===============================================================
- Hits 13550 13455 -95
+ Misses 1316 1310 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CodyCBakerPhD
added this pull request to stack #1959
October 15, 2026 17:58
…o claude/use-dev-datalad-fuse-remfile
The fork having no tags, versioneer gives the remfile-dev branch the version 0+untagged..., which does not satisfy the datalad extra's `datalad-fuse >= 0.5.1`, so pip could not resolve the requirements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
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.
Stacked on #1957. This is a try-out branch: it uses the
remfile-devbranch of CodyCBakerPhD/datalad-fuse, which is datalad/datalad-fuse#131 (pluggable backends, remfile) plus aninit_annexoption.Changes
get_adapter()creates datalad-fuse'sRemoteFilesystemAdapterwith:backends="remfile,fsspec": remfile for NWB and other HDF5-based files; fsspec for other files, and for HDF5-based files that remfile fails to open.init_annex=False: git-annex is never initialized in a clone where it is not._coalescing_block_cache(),_read_in_small_blocks()).annex_initialized(), replaced by datalad-fuse'sannex_initializedattribute._GCPausedFile): now only for files read with fsspec. remfile fetches data in the reading thread, so no finalizer can run in another thread while h5py holds its lock. With fsspec that can still deadlock even with a patched h5py: in fsspec's I/O thread, hdmf 6.2.0'sHDMFIO.__del__callsis_open(), which isbool(h5py.File)and waits for h5py's lock.remfileis added to thedataladextra.datalad-devjob installs theremfile-devbranch. Thedataladjob keeps the released datalad-fuse, where streaming is skipped.validatedocs describe the requirements.Why remfile
Reading the structure of a 16 MB NWB file in
test_annexed_readable_reads_little:Validating the 53 NWB files of 000006 (
-J 8, stock h5py 3.16):Both gave the same validation results, and nothing was downloaded into the clone. So remfile trades some bandwidth for needing no custom cache, no garbage collection pause and no h5py patch for HDF5 files.
Tests
Locally, the datalad-fuse,
validateandcmd_validatetests pass:remfile-dev+ remfileremfile-devwithout remfiletest_annexed_readable_reads_littlenow requires remfile and asserts that less than a tenth of the file is downloaded.🤖 Generated with Claude Code
https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
Generated by Claude Code