Conversation
|
@kp992 thanks for opening this. Excellent work! It is exciting to see how close we are now. From my review it looks like there a just a few issues and features we need before launch. Bugs:
Features:
|
- Add `markdown: commonmark` to all 24 lecture export configs so ipynb exports produce plain CommonMark markdown cells compatible with vanilla Jupyter Notebook, JupyterLab, and Google Colab - Add build-ipynb.yml workflow that clones QuantEcon/mystmd@myst-to-ipynb, builds from source, exports all ipynb files, and audits for MyST leaks - All 24 notebooks pass audit (0 MyST syntax leaks) Uses QuantEcon/mystmd myst-to-ipynb branch which adds: - CommonMark AST pre-transform (admonitions, math, figures, exercises, etc.) - Identifier/label stripping to prevent (label)= prefixes - Image directive stripping for plain  output - Empty cell filtering and block marker removal
Thanks @kp992 I think I have identified the root cause of this. QuantEcon/mystmd#5 |
|
Thank you @mmcky. The issue looks resolved and the generated notebooks are awesome!! |
# Conflicts: # .github/workflows/ci.yml # lectures/need_for_speed.md # lectures/numba.md # lectures/numpy_vs_numba_vs_jax.md
Aligns the lecture build with the updated QuantEcon/mystmd workflow, where main carries all squash-merged features (replacing the previous quantecon integration branch). Also surfaces VERSION.yml in build logs for diagnostic traceability of which qe-vN features are in use.
# Conflicts: # .github/workflows/ci.yml
|
Brings the branch up to date with main: the new Polars lecture, the numba lecture rewrite, the pandas_panel switch to remote CSVs, the translation sync workflows, and the jupyter-book 1.x CI changes. The only conflict was .github/workflows/ci.yml, where main and this branch have rewritten the same job for different builders. Resolved in favour of this branch's jupyter-book 2.0 job, adopting main's runner spec (volume=80gb/spot=false) and action bumps (checkout@v7, upload-artifact@v7, actions-netlify@v4) on top of it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…oling Theme: move site.template from the archived QuantEcon/quantecon-theme bundle (main.zip) to a pinned quantecon-theme.mystmd release, v2.2.0 — the current release, which carries the fancy-list rendering that pairs with the fork's fancy-lists parser (qe-v8). Pinned rather than floating so a theme release cannot change the build under us; bump the version in the URL to take a newer one. myst.yml also gets: - project.github corrected to lecture-python-programming (it pointed at lecture-python-programming.myst, which only survives as a rename redirect). The theme derives the notebook-launch repo from this value plus a ".notebooks" suffix, so a stale name means broken launch buttons. - toc brought back in line with _toc.yml: adds autodiff and the new polars lecture, drops the duplicate workspace entry from "Introduction to Python", and renames "The Scientific Libraries" to "Foundations of Scientific Computing". CI: Node 20 -> 24 (the theme's .nvmrc; it runs as a Remix server during `myst build --html`) and the remaining actions to current majors, which also clears the Node 20 runtime deprecation warnings. Adds the JAX install the jupyter-book 1.x workflow on main already does — without it the GPU lectures execute to ModuleNotFoundError cells in the preview, which the build does not fail on. Drops the unused configure-pages step; this job deploys to Netlify, not Pages. mystmd itself already comes from the QuantEcon fork's main branch, built from source with bun, with quantecon/VERSION.yml logged for traceability. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
foo.py, newfile.txt, numbers.txt, output.txt, output2.txt, test_table.csv and us_cities.txt are all written by the lectures themselves during execution (%%file / %%writefile cells in getting_started, python_essentials, python_advanced_features and debugging), and every one of them is matched by .gitignore. They were picked up by the initial mystmd setup commit and do not exist on main. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The preview build was not using QuantEcon/mystmd at all. jupyter-book 2.x is a thin Python shim: jupyter_book/__main__.py execs a compiled mystmd bundle vendored inside its own wheel (jupyter_book/dist/jupyter-book.cjs) and exposes no way to point it at a different CLI. So `jupyter book build` ignored the fork this workflow installs globally and built the site with upstream mystmd, while only the build-ipynb workflow (which calls `myst` directly) ever exercised the fork. The last run shows it plainly: the jupyter-book HTML build emitted 27 x "'output' unknown export output extension: exports/<page>.ipynb", because the per-page ipynb export is a fork feature (myst-to-ipynb, qe-v1) that upstream does not know. The same commit built by the fork's `myst build --ipynb` emitted none and exported 23 clean notebooks. `myst build --html --execute` is the same engine and the same flags — jupyter-book 2.x is mystmd — just our build of it. Dropping the jupyter-book install also removes a second, conflicting mystmd from the image. Workflow renamed to match what it now runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Refreshed against the current toolchainBranch is up to date with
The HTML build was never using the forkThis is the part worth reading. The evidence is in the last run before the fix — the jupyter-book HTML build emitted 27 × The HTML build now runs Three other things the review turned up
Also: Node 20 → 24 (the theme's Left for a decisionNothing fails the build on a notebook execution error — that is exactly how the JAX breakage stayed invisible. |
Experimental setup for building the lectures with the QuantEcon MyST stack. This PR is built on top of #345.
Current toolchain
Both workflows now build with the QuantEcon fork of the MyST CLI and the new theme, so the Netlify preview shows the latest content rendered by the latest tooling.
QuantEcon/mystmdmain, cloned and built from source with bun;quantecon/VERSION.ymlis printed to the log so every build records theqe-vNfork state it ran with (currentlyv1.10.1 (qe-v8)).github/workflows/ci.yml,.github/workflows/build-ipynb.ymlquantecon-theme.mystmdv2.2.0, pinned to the release ziplectures/myst.yml(site.template)myst build --html --execute.github/workflows/ci.ymlmainThe theme moves off the archived
QuantEcon/quantecon-themebundle (which the branch was still pulling as a floatingmain.zip) onto a pinned release of the new theme repo. Bump thevX.Y.Zin thesite.templateURL to take a newer theme; the fork stays onmaindeliberately, so the preview tracks the latest tooling.The build was not actually using the fork
Worth calling out separately, because it had been green and invisible: until this update the HTML preview was built by
jupyter book build, which cannot use the fork. jupyter-book 2.x is a thin Python shim —jupyter_book/__main__.pyexecs a compiled mystmd bundle vendored inside its own wheel (jupyter_book/dist/jupyter-book.cjs) and exposes no hook to point it at another CLI. The globally installed fork was simply ignored, and only thebuild-ipynbworkflow (which callsmystdirectly) ever exercised it.The last run before the fix shows it plainly: the jupyter-book HTML build emitted 27 ×
'output' unknown export output extension: exports/<page>.ipynb, because the per-page ipynb export is a fork feature (myst-to-ipynb,qe-v1) that upstream does not know about. The same commit built by the fork'smyst build --ipynbemitted none and exported 23 clean notebooks. The HTML build now runsmyst build --html --execute— the same engine and the same flags, since jupyter-book 2.x is mystmd, just our build of it.Everything else in this update
main. Brings in the new Polars lecture, the numba rewrite, thepandas_panelswitch to remote CSVs, and the translation-sync workflows. The one conflict wasci.yml, wheremainand this branch have rewritten the same job for different builders — resolved in favour of this branch's job, keepingmain's runner spec and action bumps.myst.ymlTOC re-synced with_toc.yml. It had drifted:autodiffand the newpolarslecture were missing,workspaceappeared twice, and one part title differed. The two files now list exactly the same 27 pages.project.githubcorrected tolecture-python-programming— it pointed atlecture-python-programming.myst, which now only survives as a rename redirect. The theme derives the notebook-launch repo from this value plus a.notebookssuffix, so a stale name means broken launch buttons.ModuleNotFoundErrorcells forjax_intro,autodiffandnumpy_vs_numba_vs_jax, because this job installed onlymyst_requirements.txtwhile the jupyter-book 1.x job onmaininstallsjax[cuda13]separately. Same install, same runner family..nvmrc; it runs as a Remix server duringmyst build --html). This also clears the Node 20 runtime deprecation warnings. The unusedconfigure-pagesstep is gone — this job deploys to Netlify, not Pages.foo.py,newfile.txt,numbers.txt,output.txt,output2.txt,test_table.csv,us_cities.txt). All are written by%%file/%%writefilecells in the lectures themselves, all are matched by.gitignore, and none exist onmain.Still open
maingained a gate for the jupyter-book 1.x path in CI: gate the first jb build so notebook errors cannot pass green #588; the fork's CLI hasmyst build --strictfor this, but it should be turned on only once the remaining build diagnostics are triaged, or it will fail on unrelated warnings.<repo>.notebooks, branchmain, notebooks at the repo root), matching the layout oflecture-python-programming.notebooks. Worth clicking through in the preview to confirm the page location resolves as expected.