From bd60ac6ddfdca67b0f70063194d840dfee4bcebf Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Thu, 19 Nov 2026 19:45:45 +1100 Subject: [PATCH 1/2] Raise the build stack to the shared baseline, pin jax 0.12.1, drop --upgrade from install lines The fourth of six pull requests, one per series, that bring the lecture series to one up-to-date baseline: QuantEcon/lectures' _base/environment-update.yml. - environment.yml: quantecon-book-theme 0.22.1 to 0.22.2, sphinx-proof 0.4.0 to 0.4.1. - cache.yml, ci.yml, publish.yml: jax[cuda13] pinned at 0.12.1, the baseline's version, in place of the newest. - ak2, kesten_processes, likelihood_ratio_process, opt_transport (twice), pandas_panel, robust_permanent_income, back_prop: --upgrade and -U dropped from the install lines. - back_prop: the `!conda install -y -c plotly plotly-orca` line removed (orca is plotly's retired exporter; kaleido makes the images), with the note that warned it fails on Colab. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL --- .github/workflows/cache.yml | 3 ++- .github/workflows/ci.yml | 3 ++- .github/workflows/publish.yml | 3 ++- environment.yml | 4 ++-- lectures/ak2.md | 2 +- lectures/back_prop.md | 12 ++---------- lectures/kesten_processes.md | 2 +- lectures/likelihood_ratio_process.md | 2 +- lectures/opt_transport.md | 4 ++-- lectures/pandas_panel.md | 2 +- lectures/robust_permanent_income.md | 2 +- 11 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 8eb18905b..e5562ab79 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -23,7 +23,8 @@ jobs: - name: Install JAX and Numpyro shell: bash -l {0} run: | - pip install -U "jax[cuda13]" + # Pinned to the lecture baseline, QuantEcon/lectures' _base/environment-update.yml. + pip install "jax[cuda13]==0.12.1" pip install numpyro python scripts/test-jax-install.py - name: Build matplotlib's font cache diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88f64be48..fb498aa4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,8 @@ jobs: - name: Install JAX and Numpyro shell: bash -l {0} run: | - pip install -U "jax[cuda13]" + # Pinned to the lecture baseline, QuantEcon/lectures' _base/environment-update.yml. + pip install "jax[cuda13]==0.12.1" pip install numpyro python scripts/test-jax-install.py - name: Build matplotlib's font cache diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5efe21030..e67432f8a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -40,7 +40,8 @@ jobs: - name: Install JAX and Numpyro shell: bash -l {0} run: | - pip install -U "jax[cuda13]" + # Pinned to the lecture baseline, QuantEcon/lectures' _base/environment-update.yml. + pip install "jax[cuda13]==0.12.1" pip install numpyro python scripts/test-jax-install.py - name: Build matplotlib's font cache diff --git a/environment.yml b/environment.yml index 7314f0d16..7f8accaea 100644 --- a/environment.yml +++ b/environment.yml @@ -7,11 +7,11 @@ dependencies: - pip - pip: - jupyter-book>=1.0.4post1,<2.0 - - quantecon-book-theme==0.22.1 + - quantecon-book-theme==0.22.2 - sphinx-tojupyter==0.6.0 - sphinxext-rediraffe==0.3.0 - sphinx-exercise==1.2.2 - - sphinx-proof==0.4.0 + - sphinx-proof==0.4.1 - sphinxcontrib-youtube==1.5.0 - sphinx-togglebutton==0.4.5 - sphinx-reredirects==1.1.0 diff --git a/lectures/ak2.md b/lectures/ak2.md index 086055e74..76a3716c2 100644 --- a/lectures/ak2.md +++ b/lectures/ak2.md @@ -26,7 +26,7 @@ In addition to what’s in Anaconda, this lecture will need the following librar ```{code-cell} ipython3 :tags: [hide-output] -!pip install --upgrade quantecon +!pip install quantecon ``` ## Overview diff --git a/lectures/back_prop.md b/lectures/back_prop.md index 03c6d881d..3d4e11da3 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -21,27 +21,19 @@ In addition to what's included in base Anaconda, we need to install the followin ```{code-cell} ipython3 :tags: [hide-output] -!pip install -U kaleido plotly -!conda install -y -c plotly plotly-orca +!pip install kaleido plotly # kaleido needs chrome to build images import kaleido kaleido.get_chrome_sync() ``` -```{note} -If you are running this on Google Colab the above cell will -present an error. This is because Google Colab doesn't use Anaconda to manage -the Python packages. However this lecture will still execute as Google Colab -has `plotly` installed. -``` - We also need to install JAX to run this lecture ```{code-cell} ipython3 :tags: [skip-execution] -!pip install --upgrade jax +!pip install jax ``` ```{code-cell} ipython3 diff --git a/lectures/kesten_processes.md b/lectures/kesten_processes.md index b704d6358..da3651649 100644 --- a/lectures/kesten_processes.md +++ b/lectures/kesten_processes.md @@ -36,7 +36,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie ```{code-cell} ipython3 :tags: [hide-output] -!pip install --upgrade quantecon yfinance +!pip install quantecon yfinance !pip install jax ``` diff --git a/lectures/likelihood_ratio_process.md b/lectures/likelihood_ratio_process.md index 7375685e7..7b4c3e8f9 100644 --- a/lectures/likelihood_ratio_process.md +++ b/lectures/likelihood_ratio_process.md @@ -30,7 +30,7 @@ In addition to what’s in Anaconda, this lecture will need the following librar ```{code-cell} ipython3 :tags: [hide-output] -!pip install --upgrade quantecon +!pip install quantecon ``` ## Overview diff --git a/lectures/opt_transport.md b/lectures/opt_transport.md index 67ae95a91..3002f038d 100644 --- a/lectures/opt_transport.md +++ b/lectures/opt_transport.md @@ -44,8 +44,8 @@ several implementations of linear programming, including, in order, ```{code-cell} ipython3 :tags: [hide-output] -!pip install --upgrade quantecon -!pip install --upgrade POT +!pip install quantecon +!pip install POT ``` Let's start with some imports. diff --git a/lectures/pandas_panel.md b/lectures/pandas_panel.md index 37eb7f82e..e17d6c626 100644 --- a/lectures/pandas_panel.md +++ b/lectures/pandas_panel.md @@ -30,7 +30,7 @@ In addition to what’s in Anaconda, this lecture will need the following librar ```{code-cell} ipython3 :tags: [hide-output] -!pip install --upgrade seaborn +!pip install seaborn ``` We use the following imports. diff --git a/lectures/robust_permanent_income.md b/lectures/robust_permanent_income.md index 90c9134a7..b56859056 100644 --- a/lectures/robust_permanent_income.md +++ b/lectures/robust_permanent_income.md @@ -30,7 +30,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie ```{code-cell} ipython3 :tags: [hide-output] -!pip install --upgrade quantecon +!pip install quantecon ``` ## Overview From 95487306cf98e7cde8d3a5432575fdba62d0428c Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Thu, 19 Nov 2026 22:37:09 +1100 Subject: [PATCH 2/2] back_prop: version floors in place of -U for kaleido and plotly Without -U, Colab keeps its preinstalled plotly 5.24.1, which cannot use kaleido 1.x ("Image export using the kaleido engine requires the kaleido package"); the Colab check failed this way. plotly 6.1.0 is the first release that supports kaleido 1.x. With floors, pip upgrades plotly only where it is older than 6.1, as on Colab, and leaves a build's pinned plotly (6.7.0) alone. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL --- lectures/back_prop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/back_prop.md b/lectures/back_prop.md index 3d4e11da3..82787db44 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -21,7 +21,7 @@ In addition to what's included in base Anaconda, we need to install the followin ```{code-cell} ipython3 :tags: [hide-output] -!pip install kaleido plotly +!pip install "kaleido>=1" "plotly>=6.1" # kaleido needs chrome to build images import kaleido