Skip to content

feat(notebooks): migrate notebooks to the bootstrap cell, fix real-browser-found bugs - #68

Merged
petercorke merged 2 commits into
mainfrom
feat/migrate-notebooks-to-bootstrap-cell
Aug 11, 2026
Merged

petercorke merged 2 commits into
mainfrom
feat/migrate-notebooks-to-bootstrap-cell

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

Two commits, each meaningful on its own:

  1. Migration — every notebook in docs/notebooks/ now uses the generated # MVTB_BOOTSTRAP_CELL (from feat(notebooks): add shared environment-bootstrap module and drift-check tooling #65's tooling) instead of a hand-pasted Colab-install snippet, or none at all. intro.ipynb and index.ipynb are relocated from docs/lite/files/ into docs/notebooks/, matching the single-source-of-truth convention every other notebook already follows — docs/lite/files/ is purely a build-time artifact again.
  2. Real-browser-found bugfixes — built and served the actual JupyterLite site locally (jupyter lite build + jupyter lite serve) and exercised it in a real browser rather than guessing. Found and fixed three real bugs: jupyter-lite.json's appUrl had a wrong files/ prefix, the notebook-adapt step only handled %matplotlib ipympl and missed %matplotlib widget (same underlying backend, two spellings), and ipywidgets was missing from the Pyodide seed-install list (needed by several notebooks' interactive sliders, independent of the matplotlib-backend question). Also confirmed live that interactive widgets (@widgets.interact + disp(reuse=True)) actually redraw correctly under Pyodide once installed.

Issue #67 (relative vs. absolute wheel-install path) was resolved and closed as part of this same real-browser testing round, before this PR was opened.

Test plan

  • pytest tests/test_notebook_bootstrap.py — 10/10 pass
  • ruff check clean
  • sync_bootstrap.py --check / clear_outputs.py --check clean across all 18 notebooks
  • Real browser, real locally-served JupyterLite site: intro.ipynb (install + Image.Read + disp), index.ipynb landing page via the fixed appUrl, fiducials.ipynb (cv2.aruco), camera.ipynb (inline backend, unaffected by the widget fix), greyscale-images.ipynb (the %matplotlib widget bug, then confirmed fixed with live slider redraw)

🤖 Generated with Claude Code

petercorke and others added 2 commits August 11, 2026 21:00
Replaces each notebook's hand-pasted Colab-install snippet (or, for the
three that had none, adds one fresh) with the generated
# MVTB_BOOTSTRAP_CELL, folded by default (metadata.jupyter.source_hidden --
inert in VS Code today, but harmless and may help other renderers; see
docs/notebooks/README.md).

Also relocates intro.ipynb and index.ipynb from docs/lite/files/ into
docs/notebooks/, matching the single-source-of-truth convention every
other notebook already follows -- docs/lite/files/ is now purely a
build-time artifact again, nothing committed under it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Built and served the actual JupyterLite site locally and exercised it in
a real browser, which surfaced three real, previously-undetected bugs:

- jupyter-lite.json's appUrl used a "files/" prefix that doesn't resolve
  correctly against this site's own base URL; confirmed the correct form
  by testing both against the real served site.
- docs.yml's notebook-adapt step only swapped "%matplotlib ipympl" for
  "%matplotlib inline", missing "%matplotlib widget" -- both select the
  same ipympl-backed backend, and only one of the two spellings was
  handled. Confirmed via a live failure in greyscale-images.ipynb
  (ModuleNotFoundError: ipympl) and confirmed the fix doesn't regress
  inline-backend notebooks (camera.ipynb, tested clean).
- ipywidgets (used directly by several notebooks for interactive sliders,
  independent of the matplotlib backend question) was missing from the
  Pyodide seed-install list. Confirmed both the fix and that interactive
  widgets actually redraw live under the "inline" backend once installed
  (tested against greyscale-images.ipynb's threshold slider).

Also has the bootstrap cell report the OpenCV version alongside MVTB's,
in the same status line.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
ErrorProne 1 high

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke merged commit 6bdf751 into main Aug 11, 2026
18 of 19 checks passed
@petercorke
petercorke deleted the feat/migrate-notebooks-to-bootstrap-cell branch October 3, 2026 14:47
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