Repository navigation
Offer each lecture's notebook for download - #87
Conversation
ci.yml and publish.yml build the notebooks with build-lectures' jupyter builder before the HTML build, and the HTML step copies them into _build/html/_notebooks/ (html-copy-notebooks), so quantecon-book-theme shows its "Download Notebook" button on every lecture page, as on the other series' sites. dp is served from a sub-path, so _config.yml sets download_nb_path to https://quantecon.github.io/lecture-dp: the theme's default link, /_notebooks/<page>.ipynb, is relative to the domain's root. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
…er series dp's setting also listed "source/_static", which doesn't exist. dp never ran the jupyter builder before, so it didn't matter; now sphinx-tojupyter warns about the missing folder and -W fails the notebook build. The other five series list "_static" alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
Validation: a full validationdp's way, as for #81, #84 and #85: a fresh build with no cache of main and of this pull request, each executing all 51 notebooks (
The pull request has two fresh builds because its first CI run failed (below) and the fix was a second commit. Both builds passed; the render restored the first, which holds the same lectures: the second commit changes only a sphinx-tojupyter setting, which the cache build doesn't use. The first CI run's failure, and the second commit. At
Not tested here: Conclusion. The pull request adds the "Download Notebook" button and the notebooks behind it to every lecture page, and nothing else a reader would see; every other difference is output noise of the kinds this series' builds already show between runs. |
The pool follow-up to QuantEcon/lecture-dp#87: sites/dp/_config.yml takes dp's two new lines, download_nb_path (https://quantecon.github.io/lecture-dp) and tojupyter_static_file_path ["_static"]; with its site-addition lines set aside, the file is byte for byte dp's at afb26ea. sync/state.yml pins dp at afb26ea, so tonight's drift check compares like with like. dp is a consumer, so no lecture enters the pool. The pool's dp site build stays HTML only, so it shows no download button until dp's build moves to the monorepo (QuantEcon/lecture-dp#86). CI's site builds passed. Merged on @mmcky's "Merge as recommended" in the organiser session. Co-authored-by: Claude Opus 5.5 <[email protected]>
…ntries; dp publishes notebooks (#98) Three changes to the one environment and its records, in one pull request as the infrastructure organiser's review of #85 proposed (2026-11-22), so the three base sites build from an empty cache once, not twice. ## What changes - **`plotly-orca` leaves `_base/environment-update.yml`.** It was listed for the three `!conda install … plotly-orca` lines in the series' lectures, which were removed upstream by 2026-11-20 with the other install lines that replaced a pin. No pool lecture installs or uses it now: no lecture in `lectures/` or in any series' `lectures/` at its pin mentions orca, and `tools/pool-check --installs` lists no install that would replace a pin. The list's header now says those lines were removed (it said they "are being removed"), names the three sites built with it (intro, advanced, programming) and says the GPU leg creates its base from `_base/environment.yml`. - **A base site's cache key hashes the list's entries, not its comments.** In `site-build.yml`, the env hash of a `base` site is the sha256 of `_base/environment-update.yml`'s lines with comments (a `#` at the start of a line or after a space) and blank lines removed, and the GPU leg's image hash takes `_base/environment.yml`'s entries the same way. So an edit to a comment no longer executes every page of intro, advanced and programming again. A `series` site (dp) keeps `hashFiles` of its `environment.yml`, whole, as dp's own cache keys hash it, so dp's key is unchanged. The comments in the workflow, `sites/README.md` and `_base/README.md` say so. - **dp publishes notebooks.** Since QuantEcon/lecture-dp#87, dp's `publish.yml` builds the notebooks as well as HTML (no PDF), so `sites/dp/site.yml` now has `publishes: [html, notebooks]`, and `sites/README.md`'s table and notes follow. Nothing reads `publishes` yet: every leg still builds HTML alone, so the pool's dp build has no "Download Notebook" button until the site build makes notebooks (the last section of QuantEcon/lecture-dp#86), which dp's shadow comparison will show. ## What the entries filter does, checked locally | Input | Result | |---|---| | main's list against this branch's | the entries differ in one line, `- plotly::plotly-orca==1.3.1` | | this branch's list against a copy with one comment reworded | the same hash | | `_base/environment.yml`, main against this branch | the same entries (only its comment changed) | Local runs on this branch: `tools/pool-check` clean (the list has 39 packages; the pool's lectures install 29 of them), the tool tests 330 passed and 1 skipped, and `tools/site-matrix` gives dp `publishes: ["html", "notebooks"]` with its `series` key inputs unchanged. ## What to expect from this pull request's builds The list's entries change, so intro, advanced and programming find no cache under their new keys and execute every page in the environment without `plotly-orca`: that is this change's test. dp's key is unchanged, so it restores main's cache. After the merge, main's push builds the three again from an empty cache and saves, and later runs restore. Copilot: not requested (Matt, 2026-11-22). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
…rve them at _notebooks/ (#104) For QuantEcon/project-monorepo#77 ("with HTML, PDF and notebooks"): the notebooks. A site whose `site.yml` publishes notebooks now gets them, as its series' own publish does: the `jupyter` builder, strict, with the notebooks served at `_build/html/_notebooks/`, where quantecon-book-theme links each page's "Download Notebook" button. All four sites built today publish notebooks: dp since QuantEcon/lecture-dp#87, and intro, advanced and programming throughout. A release from the pool (#103) needs them, as does dp's shadow comparison. ## The order, and why it differs from the series' The series build the notebooks first, then the HTML with `html-copy-notebooks`. Here that order would break the cache. On a cold build the notebook build would execute every page, the HTML build would then take every page from the cache, and the execution report, which reads the HTML build, would count 0 executed, so main would never save its cache. The theme shows the button when `_build/html/_notebooks/` is a folder as it renders a page (`os.path.isdir(app.outdir / "_notebooks")`, quantecon-book-theme 0.22.2). So: 1. make that folder; 2. build the HTML, as now: it executes the pages, and the report counts them; 3. write the execution report; 4. build the notebooks, strict, from the cache the HTML build filled (after the report, because this build rewrites the environment the report reads); 5. copy each notebook under `_build/jupyter` into `_build/html/_notebooks/` at the same path, as build-lectures' `html-copy-notebooks` does. The site gets the same files and the same buttons as the series' order would give it. Each new step runs only for a site that publishes notebooks. The notebook build has its own failure artefact, `execution-reports-<key>-notebooks`. ## What to expect from this pull request's builds The keys don't change, so every site restores its cache, and the notebook build takes every page from it. Each site's HTML gains the button and `_notebooks/`. I'll compare the result with the series' own sites (dp's 52 notebooks, as in QuantEcon/lecture-dp#87's comparison) and post it here. actionlint is clean. Copilot: not requested (Matt, 2026-11-22). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
What this changes
Implements #86: dp's pages get the "Download Notebook" button the other series' sites have.
ci.ymlandpublish.yml. Aquantecon/actions/build-lectures@v0step withbuilder: 'jupyter'runs beforeBuild HTML, writing the notebooks to_build/jupyterfrom the restored execution cache, and theBuild HTMLstep setshtml-copy-notebooks: 'true', which copies them into_build/html/_notebooks/before the HTML build. quantecon-book-theme shows the button on a page when that folder exists while the page is rendered. This is the order QuantEcon/actions' documentation gives for building notebooks for download (docs/user/composition.md, "Formats"). Each step uploads its own failure reports (execution-reports-jupyter,execution-reports-html), so the two names don't collide._config.yml. dp is served from a sub-path,https://quantecon.github.io/lecture-dp/, and the theme's default link,/_notebooks/<page>.ipynb, is relative to the domain's root.download_nb_path: https://quantecon.github.io/lecture-dpmakes each linkhttps://quantecon.github.io/lecture-dp/_notebooks/<page>.ipynb._config.yml, a second line.tojupyter_static_file_pathwas["source/_static", "_static"];source/_staticdoesn't exist in dp, and since dp never ran thejupyterbuilder before, nothing noticed. With the builder running, sphinx-tojupyter warns about the missing folder and-Wfails the notebook build (this pull request's first CI run, at400ffa2). It is now["_static"], as in the other five series.Because
ci.ymlchanges too, this pull request's own build shows the button, so the change can be checked before it reaches the live site. On the live site the button appears at the nextpublish-*tag. In a pull request's build the links point at the live site's address, where the notebooks arrive only after that publish.The monorepo
sites/dp/_config.ymlin QuantEcon/lectures copies this_config.yml, so a pull request there copies the new line once this has merged.sites/dp/site.ymlrecords that dp publishes HTML only; it changes when dp's build moves to the monorepo.Validation
Fresh builds of main and of this branch the same day, dp's way (
cache.ymlwith no cache, thenci.ymlrendering each side's own fresh cache), compared page by page, and the notebooks themselves checked against their lectures; the evidence comment follows below.Requested by @mmcky on 2026-11-26 in the lecture monorepo's working session: "Please proceed", to "Shall I open that PR now?" (this change, as #86 sets it out).
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG