Repository navigation
Avoid caching failed calcium tutorial downloads - #657
Merged
gviejo merged 1 commit intoSep 16, 2026
Merged
Conversation
gviejo
approved these changes
Sep 16, 2026
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.
The calcium-imaging tutorial writes the response straight to the final NWB filename without checking the HTTP status. An error response or an interrupted stream can leave a file that later runs treat as a completed download.
This adds an HTTP status check and a timeout, writes to a
.partfile, and renames it only after the download finishes.I checked successful downloads, HTTP errors, interrupted downloads followed by a retry, and preservation of an existing file in four local offline tests. I also downloaded the current OSF file, verified its SHA-256 against the server metadata, and opened it with
nap.load_file(..., lazy_loading=False).This is a small hardening change prompted by the invalid-HDF5 error in the documentation run for #640. The failed response was not logged, so I cannot establish its exact cause. Existing cached files are not revalidated, and I have not run a full Sphinx build.