dandi / dandi/example-notebooks
bwm_usage_notebook.ipynb fails on colab
- Dominant language
- Jupyter Notebook
- Stars
- 9
- Forks
- 20
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 29
Description
cell 18 fails for a known reason
```
# Workaround: brainglobe-atlasapi 2.3.1 fetches its atlas-version manifest
# from a Colab-unfriendly S3 endpoint that returns 403 for some Colab IPs.
# Pre-seed the cache so BrainGlobeAtlas() below can find a version manifest
# even when the live fetch fails. See https://github.com/brainglobe/brainglobe-atlasapi/issues/738
```
However it seems that the fallback doesnt work either.
Full output
```
Could not fetch the latest atlas versions: 403
Using the last cached version from /root/.brainglobe/last_versions.conf
Could not fetch the latest atlas versions: 403
Using the last cached version from /root/.brainglobe/last_versions.conf
Could not fetch the latest atlas versions: 403
Using the last cached version from /root/.brainglobe/last_versions.conf
Could not fetch the latest atlas versions: 403
Using the last cached version from /root/.brainglobe/last_versions.conf
Downloading... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0% • 0/93 bytes • speed: ? • ETA: -:--:--
---------------------------------------------------------------------------
ReadError Traceback (most recent call last)
[/usr/local/lib/python3.12/dist-packages/brainglobe_atlasapi/bg_atlas.py](https://localhost:8080/#) in download_extract_file(self)
203 try:
--> 204 tar = tarfile.open(destination_path)
205 tar.extractall(path=self.brainglobe_dir)
3 frames
ReadError: file could not be opened successfully:
- method gz: ReadError('not a gzip file')
- method bz2: ReadError('not a bzip2 file')
- method xz: ReadError('not an lzma file')
- method tar: ReadError('truncated header')
The above exception was the direct cause of the following exception:
ReadError Traceback (most recent call last)
[/usr/local/lib/python3.12/dist-packages/brainglobe_atlasapi/bg_atlas.py](https://localhost:8080/#) in download_extract_file(self)
208 # Delete corrupted file so we can try again later
209 destination_path.unlink(missing_ok=True)
--> 210 raise tarfile.ReadError(
211 f"Atlas download was interrupted or corrupted. "
212 f"Please try again. Details: {e}"
ReadError: Atlas download was interrupted or corrupted. Please try again. Details: file could not be opened successfully:
- method gz: ReadError('not a gzip file')
- method bz2: ReadError('not a bzip2 file')
- method xz: ReadError('not an lzma file')
- method tar: ReadError('truncated header')
```
I tried clearing the cache, and retrying the download but this error seems to persist.
Contributor guide
No contributing guide indexed for this repository
Research direction
Open bwm_usage_notebook.ipynb in Colab and reproduce the failure in cell 18, starting with the brainglobe-atlasapi 2.3.1 workaround and the linked atlasapi issue 738. Check why the cached version fallback still leads to a 0-byte or invalid atlas archive; done means the cell completes and the atlas download extracts successfully after clearing or retrying the cache.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100