Skip to content

Raise the build stack to the shared baseline, pin kaleido, drop --upgrade from install lines - #416

Merged
mmcky merged 1 commit into
mainfrom
env-baseline
Nov 19, 2026
Merged

mmcky merged 1 commit into
mainfrom
env-baseline

Conversation

@mmcky

@mmcky mmcky commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

What

The fifth of six pull requests, one per series, that bring the lecture series to one up-to-date baseline: the environment the QuantEcon lecture monorepo's sites are to build in, _base/environment-update.yml in QuantEcon/lectures. The others are QuantEcon/lecture-python-intro#872, QuantEcon/lecture-python-programming#663 and QuantEcon/lecture-python-programming#665, QuantEcon/lecture-jax#374 and QuantEcon/lecture-python.myst#1135.

File Change
environment.yml quantecon-book-theme 0.22.0 to 0.22.2, sphinx-exercise 1.2.1 to 1.2.2, sphinx-proof 0.4.0 to 0.4.1, and kaleido pinned at 1.5.2. These are the baseline's versions; the rest of the build stack is already at them.
40 lectures --upgrade dropped from 43 install lines: quantecon in 41, and optax and statsmodels in calvo_machine_learn
BCG_incomplete_mkts, knowing_forecasts_of_others !conda install -y -c plotly plotly plotly-orca becomes !pip install kaleido, the line BCG_complete_mkts already has

Why the install lines change

In a build every lecture runs in one environment, so an --upgrade line replaces the version the environment pins, for every lecture executed after it. Without --upgrade, the line installs the package where it is missing and leaves it alone where it is there.

  • quantecon and optax aren't in Anaconda, so their lines still install the newest release.
  • statsmodels is in Anaconda. It now stays at Anaconda 2026.07's 0.14.6, the baseline's version, where --upgrade replaced it with the newest.
  • orca is plotly's retired image exporter. These lectures export their figures with engine="kaleido", so orca is never used, and the conda line also replaced the environment's plotly. kaleido is what the lectures need, and environment.yml installs it for the build.

kaleido 1.x needs a Chrome. GitHub's ubuntu-latest runners carry one, and main's builds already run all three Kaleido lectures with kaleido 1.5.1. QuantEcon/actions#342 added a pinned Chrome for Testing to QuantEcon's container images, which the monorepo's builds will use.

For the reviewer, two content points:

Validation

By the owner's rule for any software upgrade on a series, this merges only after a full validation of the site: fresh builds of main and of this branch with every lecture executed, compared for new warnings (DeprecationWarning, FutureWarning, Sphinx), changed cell outputs and rendering regressions page by page, plus the Colab path. The evidence follows in a comment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

…rade from install lines

- environment.yml: quantecon-book-theme 0.22.2, sphinx-exercise 1.2.2,
  sphinx-proof 0.4.1, kaleido==1.5.2, the versions of the lecture
  baseline, QuantEcon/lectures' _base/environment-update.yml.
- --upgrade dropped from 43 install lines (quantecon, optax, statsmodels):
  in a build every lecture runs in one environment, so an --upgrade line
  replaces the version the environment pins for every lecture executed
  after it.
- BCG_incomplete_mkts and knowing_forecasts_of_others: the
  `!conda install -y -c plotly plotly plotly-orca` line becomes
  `!pip install kaleido`, as in BCG_complete_mkts. The lectures export
  their figures with engine="kaleido"; orca, plotly's retired exporter,
  is not used, and the conda line also replaced the environment's plotly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 21:02
@netlify

netlify Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit 96d9ea8
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/6aff63fb4451fc7a10e467b3
😎 Deploy Preview https://deploy-preview-416--lustrous-melomakarona-3ee73e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The supplied evidence lacks the required fresh main/branch execution, warning/output and rendering comparisons, and Colab validation, which static inspection and cached CI cannot establish.

No open issues 🎉

What changed in this PR

This PR aligns the advanced Python lecture series with QuantEcon’s shared build baseline and prevents lecture setup cells from unnecessarily upgrading installed packages.

Changes:

  • Updates the book theme and Sphinx extensions, and pins Kaleido to 1.5.2.
  • Removes --upgrade from 43 installation commands across 40 lectures.
  • Replaces two obsolete Plotly/Orca conda commands with Kaleido installation commands.
File Description
lectures/​tax_smoothing_3.md Removes forced quantecon upgrade.
lectures/​tax_smoothing_2.md Removes forced quantecon upgrade.
lectures/​tax_smoothing_1.md Removes forced quantecon upgrade.
lectures/​supply_demand_var.md Removes forced quantecon upgrade.
lectures/​stationary_densities.md Removes forced quantecon upgrade.
lectures/​smoothing.md Removes forced quantecon upgrade.
lectures/​smoothing_tax.md Removes forced quantecon upgrade.
lectures/​rosen_schooling_model.md Removes forced quantecon upgrade.
lectures/​robustness.md Removes forced quantecon upgrade.
lectures/​rob_markov_perf.md Removes forced quantecon upgrade.
lectures/​policy_invertibility.md Removes forced quantecon upgrade.
lectures/​policy_counterfactuals.md Removes forced quantecon upgrade.
lectures/​permanent_income_dles.md Removes forced quantecon upgrade.
lectures/​opt_tax_recur.md Removes forced quantecon upgrade.
lectures/​muth_kalman.md Removes forced quantecon upgrade.
lectures/​markov_jump_lq.md Removes forced quantecon upgrade.
lectures/​lucas_asset_pricing_dles.md Removes forced quantecon upgrade.
lectures/​lqramsey.md Removes forced quantecon upgrade.
lectures/​knowing_forecasts_of_others.md Removes quantecon upgrade; replaces Orca setup with Kaleido.
lectures/​irfs_in_hall_model.md Removes forced quantecon upgrade.
lectures/​induced_priors.md Removes forced quantecon upgrade.
lectures/​hs_invertibility_example.md Removes forced quantecon upgrade.
lectures/​growth_in_dles.md Removes forced quantecon upgrade.
lectures/​gorman_heterogeneous_households.md Removes forced quantecon upgrade.
lectures/​estspec.md Removes forced quantecon upgrade.
lectures/​dyn_stack.md Removes forced quantecon upgrade.
lectures/​discrete_dp.md Removes forced quantecon upgrade.
lectures/​cons_news.md Removes forced quantecon upgrade.
lectures/​cattle_cycles.md Removes forced quantecon upgrade.
lectures/​calvo.md Removes forced quantecon upgrades in both setup cells.
lectures/​calvo_machine_learn.md Removes forced quantecon, optax, and statsmodels upgrades.
lectures/​calvo_abreu.md Removes forced quantecon upgrade.
lectures/​BCG_incomplete_mkts.md Removes quantecon upgrade; replaces Orca setup with Kaleido.
lectures/​BCG_complete_mkts.md Removes forced quantecon upgrade; retains Kaleido setup.
lectures/​arma.md Removes forced quantecon upgrade.
lectures/​arellano.md Removes forced quantecon upgrade.
lectures/​amss3.md Removes forced quantecon upgrade.
lectures/​amss2.md Removes forced quantecon upgrade.
lectures/​amss.md Removes forced quantecon upgrade.
lectures/​additive_functionals.md Removes forced quantecon upgrade.
environment.yml Updates theme and Sphinx extension pins; pins Kaleido to 1.5.2.

Review effort: Balanced (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions
github-actions Bot temporarily deployed to pull request November 19, 2026 21:39 Inactive
@mmcky

mmcky commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Full site validation: no new warnings and no regressions. The intended changes are the only behavioural ones: statsmodels and plotly are no longer replaced partway through the build.

  • Fresh builds with no cache, every lecture executed (78 notebooks each, ubuntu-latest), both green:

    • main at 563576a (run 44614788136), with quantecon-book-theme 0.22.0, sphinx-exercise 1.2.1, sphinx-proof 0.4.0 and the newest kaleido, 1.5.2;
    • this PR at 96d9ea8 (run 44614794801), with theme 0.22.2, sphinx-exercise 1.2.2, sphinx-proof 0.4.1 and kaleido==1.5.2.

    Apart from those three packages, the two builds' environments are created identically. jax is 0.12.1 on both sides, installed by the lectures' own lines.

    A second build of this PR at the same commit (run 44629142429) settles the round-off differences described below.

  • Logs: neither build's Build HTML step logs a DeprecationWarning, FutureWarning or Sphinx warning. The only warning lines are conda's setup notices, the same on both sides. The PR's first build also logs one Exception in thread Heartbeat (ZMQError: Address already in use) as additive_functionals' kernel started. It's a port race when Jupyter starts a kernel: the notebook executed normally, its outputs match main's, and main's own build hit the same race on 2026-09-21 (run 35556970534), at a different lecture. The PR's second build's log matches main's exactly.

  • Cell outputs: the warnings in cell outputs are the same on both sides, 28 on nine pages, all there before this PR. Two are deprecations: plotly's DeprecationWarning for the engine="kaleido" argument, seven times across the three Kaleido lectures, and Matplotlib's MatplotlibDeprecationWarning for passing marker to scatter() positionally, twice in chang_credible. Passing marker by keyword and dropping the engine argument would clear them, as a separate change. The rest are numerical: RuntimeWarnings in amss2 and amss3, ComplexWarnings in arma and estspec, a log-axis UserWarning in arma, and quantecon's non-convergence warning in discrete_dp. (Corrected 2026-11-20: this bullet first named only plotly's warning.)

  • The three Kaleido lectures (BCG_complete_mkts, BCG_incomplete_mkts, knowing_forecasts_of_others) execute on both sides with kaleido 1.5.2 and the runner's Chrome. Their 21 figures are byte-identical on both sides.

  • The changed install lines:

    • On main, calvo_machine_learn's --upgrade statsmodels replaces Anaconda's 0.14.6 with 0.15.0, for every lecture executed after it. On this branch, statsmodels stays at 0.14.6, the baseline's version.
    • On main, the conda line in BCG_incomplete_mkts and knowing_forecasts_of_others installs plotly-orca 1.3.1 (56.6 MB), which nothing uses. On this branch, !pip install kaleido finds kaleido already installed.
    • The quantecon and optax lines give the same result with or without --upgrade: quantecon 0.13.1 and optax 0.2.9, the newest releases.
  • Page by page (83 pages): every page has the same counts of exercises, solutions, admonitions, figures, tables, math and cell outputs on both sides.

    • Most of the pages whose outputs differ also differ between two earlier builds of main (run 42554869417 and run 43796515672, 9 and 16 November): timings, download bars, simulations and MCMC.
    • The first PR build also differed from main on ten more pages, by round-off only: floats in the last digits, values near 1e-14, signs of zero and of eigenvectors. They are classical_filtering, dyn_stack, gorman_heterogeneous_households, growth_in_dles, hansen_richard_1987, irfs_in_hall_model, policy_invertibility, policy_regimes, smoothing_tax and supply_demand_var, plus float32 digits in calvo_machine_learn. classical_filtering imports only numpy, so no package this PR changes could reach it.
    • The second PR build gives main's exact outputs on eight of those pages and on calvo_machine_learn. The other three (policy_invertibility, policy_regimes, supply_demand_var) vary between builds of main too. So the first build's differences came from that run, not from this change. The likely cause is the runner's CPU, since BLAS takes different code paths on different processors.
    • Compared with main, the second PR build differs only on pages that also differ between the two earlier builds of main.
  • Theme 0.22.0 to 0.22.2, as its changelog describes: rel="noopener" on links that open a new tab, the contrast button's tooltip "Toggle dark mode" (on all 81 lecture pages), and new digests on the theme's CSS and JS.

  • Colab path: this series has no Colab check, so I ran the lectures whose behaviour on Colab can change, locally, before and after, with Colab's own preinstalled versions (Python 3.13, jax 0.11.1, optax 0.2.8, statsmodels 0.15.0, quantecon 0.13.1, plotly 5.24.1).

    • calvo_machine_learn runs clean on both sides. Before, it upgrades optax 0.2.8 to 0.2.9; after, it keeps Colab's 0.2.8. Every output is identical apart from timings.
    • The three Kaleido lectures fail on Colab both before and after, at the same cells, with the same error: plotly 5.x raises "Image export using the kaleido engine requires the kaleido package". Before, kaleido was never installed, since Colab has no conda. After, kaleido 1.5.2 is installed, but Colab's plotly 5.24.1 can't use it. The PR body's second point is about making them run there.
    • Elsewhere on Colab, quantecon 0.13.1, the newest, is preinstalled, so the plain lines leave it as the --upgrade lines did.

@mmcky
mmcky merged commit 7477752 into main Nov 19, 2026
12 checks passed
@mmcky
mmcky deleted the env-baseline branch November 19, 2026 23:21

This branch was previously deployed

1 inactive deployment
pull request — 96d9ea8c Deployed Nov 19, 2026 by github-actions[bot]
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.

2 participants