Repository navigation
Kaleido lectures: drop to_image's deprecated engine argument - #421
Conversation
BCG_complete_mkts, BCG_incomplete_mkts and knowing_forecasts_of_others
call plotly's fig.to_image(format="png", engine="kaleido"). Plotly has
deprecated the engine argument, since Kaleido is now its only engine, so
each of the seven calls printed a DeprecationWarning ("Support for the
'engine' argument is deprecated and will be removed after September 2025.
Kaleido will be the only supported engine at that time.") into its
output. Without the argument plotly uses Kaleido all the same, so the
images are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
✅ Deploy Preview for lustrous-melomakarona-3ee73e ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Validation: a full validationTwo fresh builds with no cache, each executing all 77 notebooks,
The three Kaleido lectures. In each, the seven DeprecationWarnings are gone, and every image is byte-identical to main's. The only other difference is the CPU time one cell prints.
Build logs. The same warning lines on both sides, and no Sphinx warning on either. The rest of the HTML. 37 of 85 pages differ in all. Besides the three above, there are 33 pages of output noise or figure file names, the same as between any two builds: unseeded draws, timings, memory addresses and solver printouts, and figures drawn again with new names. There is also the status page, with its build times. The warnings in the other pages' outputs are the same on both sides. |
There was a problem hiding this comment.
🔵 Needs a closer look
Because the PR changes executable lecture content and rendered figures across three pages, confirming Plotly/Kaleido output and narrative alignment requires environment-specific execution and human review.
No open issues 🎉
What changed in this PR
This PR removes Plotly’s deprecated engine="kaleido" argument from lecture figure exports, eliminating deprecation warnings while preserving PNG rendering through Kaleido’s default behavior.
Changes:
- Updated one image export in
knowing_forecasts_of_others.md. - Updated five image exports in
BCG_incomplete_mkts.md. - Updated one image export in
BCG_complete_mkts.md.
| File | Description |
|---|---|
| lectures/knowing_forecasts_of_others.md | Removes the deprecated engine argument from one Plotly image export. |
| lectures/BCG_incomplete_mkts.md | Removes the deprecated engine argument from five Plotly image exports. |
| lectures/BCG_complete_mkts.md | Removes the deprecated engine argument from one Plotly image export. |
Review effort: Lite (adaptive)
Validation correction: pages whose only difference is a figureThe evidence comment above says 37 of 85 pages differ. The comparison behind it compared a figure only when the page wraps it in a link, and this series doesn't, so a page whose only difference is a figure wasn't counted. With every figure now compared by content, 52 of 85 pages differ. The 15 added pages differ only in figures:
This pull request's own pages. The three Kaleido lectures it changes have byte-identical images on both sides, as the evidence comment says. None of the added pages is one this pull request changes, and each also differs when the same main build is compared with the build of #423, which changes only the conda channel's name and installs the same packages. The conclusion doesn't change: no other page's prose differs. |
The nightly of 2026-11-23 re-copies 19 pool lectures whose canonical copy moved upstream: intermediate 12 (QuantEcon/lecture-python.myst#1144, QuantEcon/lecture-python.myst#1147 and QuantEcon/lecture-python.myst#1141), advanced 5 (QuantEcon/lecture-python-advanced.myst#419, QuantEcon/lecture-python-advanced.myst#421 and QuantEcon/lecture-python-advanced.myst#422) and intro 2 (QuantEcon/lecture-python-intro#876). In the merged bibliography only the header's jax input hash changes (QuantEcon/lecture-jax#377); its 1011 entries are unchanged. In sync/ledger.yml only pins and digests change. Checked by mini:project-monorepo's recompute from a clean clone at the base, which gives the head's tree, and by the organiser's independent review: each lecture is byte-identical to its upstream copy at the new pin once the recorded asset rewrites are applied, no bibliography key is missing and no cross-reference is broken. The site-build, pool-check and drift-check runs on the head were green before merge. Lecture content: reviewed by @mmcky ("Approve runs, then merge") in the organiser session, at head a815b36. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
What
BCG_complete_mkts (1 call), BCG_incomplete_mkts (5) and knowing_forecasts_of_others (1) export their plotly figures with
fig.to_image(format="png", engine="kaleido"). Plotly has deprecated theengineargument: it uses Kaleido whenever Kaleido is installed, and falls back to its deprecated Orca engine only when it is not. So each of the seven calls prints this into its output:Image(fig.to_image(format="png", engine="kaleido"))(andfig1once)Image(fig.to_image(format="png"))Without the argument plotly uses Kaleido all the same, so the images should be unchanged. The warnings were found by the environment scan of 2026-11-19, and they are also in the build of this site from the lecture monorepo (QuantEcon/lectures#86). This is part of reporting lecture fixes upstream to each lecture's source of truth (QuantEcon/project-monorepo#77).
Validation
Done on 2026-11-22, a full validation: fresh builds with no cache of this pull request and of main, every notebook executed, both green. The evidence is in the comment below.
This changes lecture content, so it needs a person's review.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL