Repository navigation
feat(notebooks): migrate notebooks to the bootstrap cell, fix real-browser-found bugs - #68
Merged
Merged
Conversation
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>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
🟢 Metrics 0 complexity · 0 duplication
Metric Results Complexity 0 Duplication 0
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.
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.
Summary
Two commits, each meaningful on its own:
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.ipynbandindex.ipynbare relocated fromdocs/lite/files/intodocs/notebooks/, matching the single-source-of-truth convention every other notebook already follows —docs/lite/files/is purely a build-time artifact again.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'sappUrlhad a wrongfiles/prefix, the notebook-adapt step only handled%matplotlib ipympland missed%matplotlib widget(same underlying backend, two spellings), andipywidgetswas 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 passruff checkcleansync_bootstrap.py --check/clear_outputs.py --checkclean across all 18 notebooksintro.ipynb(install + Image.Read + disp),index.ipynblanding page via the fixedappUrl,fiducials.ipynb(cv2.aruco),camera.ipynb(inline backend, unaffected by the widget fix),greyscale-images.ipynb(the%matplotlib widgetbug, then confirmed fixed with live slider redraw)🤖 Generated with Claude Code