Skip to content

Raise the build stack to the shared baseline, drop --upgrade from install lines - #75

Merged
mmcky merged 1 commit into
mainfrom
env-baseline
Nov 20, 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 last 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, QuantEcon/lecture-python.myst#1135 and QuantEcon/lecture-python-advanced.myst#416.

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: the baseline's versions, and the ones the quantecon-build image already holds
17 lectures --upgrade dropped from 20 install lines: quantecon in 18, and optax and statsmodels in calvo_machine_learn. These are the lines their sources dropped in QuantEcon/lecture-python-advanced.myst#416

It supersedes dependabot's #71, #73 and #74, which bump the same three packages.

What changes in the build

dp builds in the ghcr.io/quantecon/quantecon-build image, which doesn't install environment.yml. The image already holds theme 0.22.2, sphinx-exercise 1.2.2 and sphinx-proof 0.4.1, so the build stack doesn't change. environment.yml's hash is part of the build cache's key, so the change gives the cache a fresh key, and the file states the versions the builds use.

In a build every lecture runs in one environment, so an --upgrade line replaces the version the environment holds for every lecture executed after it. In the image:

  • quantecon and optax aren't installed, so their lines install the newest release with or without --upgrade.
  • statsmodels is 0.14.6, the baseline's version. calvo_machine_learn's --upgrade statsmodels replaced it with the newest, 0.15.0, for every lecture after it. Now it stays.

14 of the 17 lectures are now byte-identical to advanced's copies. cons_news, markov_jump_lq and opt_tax_recur already differed from advanced elsewhere, and still do.

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. cache.yml keeps its build as the cache rather than as an artifact, so a ci.yml run on each side follows it, restores that cache and uploads the HTML to compare. The evidence follows in a comment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

…tall lines

- environment.yml: quantecon-book-theme 0.22.2, sphinx-exercise 1.2.2,
  sphinx-proof 0.4.1, the versions of the lecture baseline, QuantEcon/lectures'
  _base/environment-update.yml, and of the quantecon-build image the builds
  run in.
- --upgrade dropped from 20 install lines in 17 lectures (quantecon, optax,
  statsmodels), as in their sources: 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.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human verification is needed because the supplied evidence lacks the required fresh main/branch builds executing every lecture, warning/output and page-by-page rendering comparisons, and Colab validation.

No open issues 🎉

What changed in this PR

Aligns the dynamic programming lecture series with the shared QuantEcon build baseline and removes forced package upgrades from lecture install cells. This consolidates the dependency updates proposed in #71, #73, and #74.

Changes:

  • Updates the theme, exercise, and proof package pins to the versions already used by the build image.
  • Removes --upgrade from 20 install commands across 17 lectures, preserving installed packages, including the baseline statsmodels version.
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/​smoothing.md Removes forced quantecon upgrade.
lectures/​smoothing_tax.md Removes forced quantecon upgrade.
lectures/​opt_tax_recur.md Removes forced quantecon upgrade.
lectures/​markov_jump_lq.md Removes forced quantecon upgrade.
lectures/​lqramsey.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/​calvo.md Removes forced quantecon upgrades from two cells.
lectures/​calvo_machine_learn.md Removes forced quantecon, optax, and statsmodels upgrades.
lectures/​calvo_abreu.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.
environment.yml Pins theme 0.22.2, sphinx-exercise 1.2.2, and sphinx-proof 0.4.1.

Review effort: Balanced (adaptive)

@mmcky

mmcky commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Full site validation: no new warnings and no regressions. The intended change is the only behavioural one: statsmodels is no longer upgraded partway through the build.

  • Fresh builds with no cache, every lecture executed (51 notebooks each) in ghcr.io/quantecon/quantecon-build:latest, both green: main at da83d88 (run 44637743075) and this PR at 389bcb1 (run 44637747318).

    • cache.yml keeps its build as the cache, not as an artifact. So a ci.yml run on each side followed it: main (run 44643724765) and this branch (run 44643729674). Each restored its own side's fresh cache (the cache keys name the runs above), executed nothing, and uploaded the HTML compared below.
    • Both sides build in the same image, which doesn't install environment.yml, so the build stack is the same on both: theme 0.22.2, sphinx-exercise 1.2.2, sphinx-proof 0.4.1.
  • Logs: neither build logs a warning. The only lines that match WARNING, ERROR or CRITICAL are the cache action's own script, echoed into the log, the same on both sides.

  • Cell outputs: the same 11 warnings on both sides, on four pages, all there before this PR. Neither side has a traceback.

    • chang_credible: MatplotlibDeprecationWarning ×2, for passing marker to scatter() positionally, deprecated since Matplotlib 3.10. Advanced's copy shows the same.
    • amss2 and amss3: RuntimeWarning ×4 each: divide by zero in power and reciprocal, invalid value in divide and multiply.
    • discrete_dp: quantecon's RuntimeWarning "max_iter attained before convergence in compute_fixed_point".

    The "Error at iteration" lines in amss, jv, odu, os_numerical and os_stochastic are those lectures' convergence printouts.

  • The changed install lines:

    • On main, calvo_machine_learn's --upgrade statsmodels replaces the image's 0.14.6 with 0.15.0, together with formulaic, interface-meta and wrapt 2.6.0.dev1, a development release, for every lecture executed after it. The status page's conda list shows them. On this branch statsmodels stays at 0.14.6, the baseline's version.
    • quantecon and optax aren't in the image, so both sides install the newest, 0.13.1 and 0.2.9.
  • Page by page (57 pages): every page has the same counts of exercises, solutions, admonitions, figures, tables, math and cell outputs on both sides. The outputs differ on 14 pages:

  • Theme: the HTML's theme markup is the same on both sides, since both build in the same image.

  • Colab path: this series has no Colab check. Its changed lines are those Raise the build stack to the shared baseline, pin kaleido, drop --upgrade from install lines lecture-python-advanced.myst#416 changed, and dp's calvo_machine_learn is byte-identical to advanced's. So that PR's local Colab-path run, with Colab's own preinstalled versions, covers them:

    • calvo_machine_learn keeps Colab's optax 0.2.8 where --upgrade installed 0.2.9, and gives identical results;
    • Colab preinstalls quantecon 0.13.1, the newest, so the plain lines leave it as the --upgrade lines did.

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