Sargolini2006: drop arbitrary numpy<2 cap, match Colab versions#157
Conversation
The PR-141-era input deps included `numpy>=1.26,<2` for this notebook, which forced the resolver to pin numpy==1.26.4. That cap appears to have been a precaution at the time — the notebook code itself is fully numpy-2.x compatible (no removed APIs like np.NaN/np.product/etc), and the chosen pynapple==0.11.1 already works against numpy 2.0.2. Updated direct deps: - numpy>=1.26,<2 -> numpy>=1.26 - pynapple>=0.6 -> pynapple>=0.11 Re-resolved against the Colab preinstalled-package constraint set (.github/colab-preinstalled.txt, brought in from #149's colab-bootstrap-locked branch which had it but didn't make it to master in the merge). Key resolved pins now match Colab exactly: numpy==2.0.2 <- matches Colab; no kernel restart on install pandas==2.2.2 <- matches Colab scipy==1.16.3 <- matches Colab h5py==3.16.0 <- matches Colab plotly==5.24.1 <- matches Colab pynapple==0.11.2 <- latest, supports numpy 2.x Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
Preview for this PR has been removed (PR closed). |
Previously the notebook called plotly's `fig.show()` without setting a
renderer. In Colab and Jupyter that auto-detects; in headless CI it
falls back to opening a browser tab and raises 'could not locate
runnable browser'. The notebook was on
`.github/notebook-test-exclusions.txt` for that reason.
Two changes:
1. New code cell (inserted right after the restart-admonition):
import plotly.io as pio
pio.renderers.default = "iframe"
Renders figures inline as a self-contained iframe — works in Colab,
Jupyter, and headless nbconvert/ipython runners.
2. Remove the Sargolini entry from `.github/notebook-test-exclusions.txt`.
The notebook is now CI-testable.
Also cleans up an unrelated stray line in the install cell ('Resolved
103 packages in 569ms') that crept in from a 2>&1 stderr-redirect in
my prior regen — that string would have failed at `!uv pip install`
because it isn't a valid package spec.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Pushed What changed
Net effectAfter this lands:
|
CI flagged 'CliVersionTooOldError: Client version 0.68.1 is too old! Server requires at least version 0.74.0' on the first cell that constructs DandiAPIClient(). The original input had `dandi>=0.56` (a stale floor from PR #141). Bumping to `dandi>=0.74` triggered a constraint conflict against Colab's `click==8.3.3` because dandi >=0.74 caps click at <8.2. Resolved by dropping click from the constraint set for this notebook — click downgrades from 8.3.3 to 8.1.8, a small CLI lib that doesn't trigger a kernel restart on its own. All other core-stack pins still match Colab exactly: dandi==0.75.1 (was 0.68.1; meets server min of 0.74.0) click==8.1.8 (was 8.3.3 in Colab; small downgrade) numpy==2.0.2 matches Colab pandas==2.2.2 matches Colab scipy==1.16.3 matches Colab h5py==3.16.0 matches Colab plotly==5.24.1 matches Colab pynapple==0.11.2 latest, supports numpy 2.x Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Applies the same Colab-version-matching approach that landed in PR dandi#157 (Sargolini2006) to the rest of the bootstrapped notebooks. Wherever a notebook's direct deps allow, the lock now matches Colab's preinstalled version exactly — so the install cell becomes a no-op for those packages and no kernel restart is needed on Colab. Adds .github/colab-preinstalled.txt (Colab's pip-freeze from googlecolab/backend-info, refreshed 2026-05-13). Each notebook's lock is then resolved with this file as a uv `--constraint`. Two systematic adjustments applied during regen: 1. dandi floor bumped to >=0.74. The DANDI server now rejects clients older than 0.74 with CliVersionTooOldError. PR-141-era inputs had `dandi>=0.60` which let the resolver pick stale versions. The regen pipeline bumps the floor to 0.74 in every notebook's input. 2. click dropped from Colab constraints where needed. Colab ships click==8.3.3 but dandi >=0.74 caps click at <8.2. Resolution drops click for affected notebooks; it downgrades to 8.1.x. Click is a small CLI lib with no C extension or numpy dep, so the downgrade doesn't trigger a kernel restart. Results across the 30 regenerated notebooks (Sargolini2006 already covered by dandi#157, test-excluded notebooks skipped): - Every notebook now pins dandi >=0.74 (or doesn't depend on dandi Python client at all — NWBWidget-demo uses requests directly). - numpy unchanged at 2.0.2 (Colab default) on every notebook EXCEPT: * the dattalab reproduce_figure_* (numpy<2 for cellpose/np.NaN) * Turner motor-cortex (env.yml hard-pins numpy==2.2.6) - pandas, scipy, h5py, plotly, matplotlib, etc. all match Colab wherever the notebook doesn't have specific older-version constraints. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The PR-141-era input deps for this notebook included
numpy>=1.26,<2, which forced the resolver to pinnumpy==1.26.4. Looking at the notebook content:np.NaN,np.product,np.float_, etc).pynapple==0.11.1already supportsnumpy==2.0.2(verified viauv pip compile).The
<2cap was a precaution that's no longer needed. Dropping it lets this notebook match Colab's preinstallednumpy==2.0.2— which means the install cell becomes a no-op for numpy and no kernel restart is required on Colab.Direct-dep changes
Resolved pins now match Colab exactly
Why is
.github/colab-preinstalled.txtnew in this PRI had originally added that constraints file in
7dd37f8on thecolab-bootstrap-lockedbranch, but it was pushed after #149 was merged, so it didn't reach master. Bringing it in here so the Sargolini re-resolution can use it. A separate, broader follow-up PR could re-apply the same regen to the other 41 notebooks that already have bootstraps — most would benefit from the same Colab-matching effect.🤖 Generated with Claude Code