Skip to content

Regenerate locks against Colab preinstalled versions#159

Merged
bendichter merged 1 commit into
masterfrom
regen-locks-colab-match
May 13, 2026
Merged

Regenerate locks against Colab preinstalled versions#159
bendichter merged 1 commit into
masterfrom
regen-locks-colab-match

Conversation

@bendichter
Copy link
Copy Markdown
Member

Applies the Colab-version-matching approach from PR #157 (Sargolini2006) to the rest of the bootstrapped notebooks (30 of them). 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 on a fresh Colab runtime and no kernel restart is needed.

What's added

  • .github/colab-preinstalled.txt — Colab's pip-freeze, sourced from googlecolab/backend-info on 2026-05-13. Each notebook's lock is regenerated with this file as a uv pip compile --constraint.

Two systematic adjustments

  1. dandi>=0.74 floor. The DANDI server now rejects clients older than 0.74 with CliVersionTooOldError. PR-141-era inputs had dandi>=0.60, which the resolver was happy to satisfy with stale 0.68.x — that crashes at the first DandiAPIClient() call. Bumped the floor in every input.

  2. click dropped from Colab constraints where needed. Colab has click==8.3.3, but dandi >=0.74 caps click at <8.2. The iterative resolver drops click from constraints and lets uv pick a compatible version (click==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 — 30 notebooks regenerated

Property Outcome
dandi pin >= 0.74 ✅ every notebook (NWBWidget-demo is a transitive-only dandi user; no DandiAPIClient call)
numpy==2.0.2 (matches Colab) ✅ all except the 2 dattalab reproduce_figure_* (need numpy<2) and 4 Turner motor-cortex (env.yml hard-pins numpy==2.2.6)
pandas==2.2.2, scipy==1.16.3, h5py==3.16.0, matplotlib==3.10.0, plotly==5.24.1 ✅ match Colab on every notebook that doesn't have notebook-specific overrides

Out of scope

  • Sargolini2006 — already covered by Sargolini2006: drop arbitrary numpy<2 cap, match Colab versions #157 (same constraints file, no-conflict merge).
  • Notebooks on .github/notebook-test-exclusions.txt — skipped here since CI doesn't test them anyway. Their bootstraps still have older locks; a follow-up could regenerate those for the Colab-button UX, but they have other blocking issues that need fixing first.

How to verify

Per-PR CI will exercise each touched notebook automatically. Spot-check after merge by opening any non-dattalab/non-Turner notebook in Colab — the !uv pip install cell should report most packages as "already satisfied".

🤖 Generated with Claude Code

Applies the same Colab-version-matching approach that landed in PR #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 #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>
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Preview for this PR has been removed (PR closed).

github-actions Bot added a commit that referenced this pull request May 13, 2026
@bendichter bendichter merged commit d65a022 into master May 13, 2026
29 of 34 checks passed
github-actions Bot added a commit that referenced this pull request May 13, 2026
bendichter added a commit to catalystneuro/example-notebooks that referenced this pull request May 14, 2026
…i#156)

The lock generated by PR dandi#159 pinned `numpy==1.26.4` because the
PR-141-era input deps included `numpy>=1.26,<2`. That cap was there
because the notebook used `np.NaN` (removed in numpy 2.0). PR dandi#156
already replaced `np.NaN` with `np.nan`, so the cap is now stale
and the notebook code is numpy-2.x clean.

Re-resolved with `numpy>=1.26` (no upper cap) against the Colab
constraints set. The only line that changed is the numpy pin —
everything else was already at Colab versions:

  numpy   1.26.4 -> 2.0.2  (matches Colab — no restart on install)

Now the install on Colab is fully no-op for numpy/pandas/scipy/h5py/etc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant