From 4dfd5fa86a6c908bab00af60cc67e0e9128cb0aa Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 30 Jul 2025 11:04:27 +1000 Subject: [PATCH 1/6] MAINT: upgrade anaconda=2025.06 and python=3.13 --- .github/workflows/cache.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 2 +- environment.yml | 19 ++++++++++--------- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index ec7536a5b..97fcc8a37 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -17,7 +17,7 @@ jobs: auto-update-conda: true auto-activate-base: true miniconda-version: 'latest' - python-version: "3.12" + python-version: "3.13" environment-file: environment.yml activate-environment: quantecon - name: Install JAX, Numpyro, PyTorch diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22db382f1..33846cf40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: auto-update-conda: true auto-activate-base: true miniconda-version: 'latest' - python-version: "3.12" + python-version: "3.13" environment-file: environment.yml activate-environment: quantecon - name: Install JAX, Numpyro, PyTorch diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b0a9a6c8f..586be89eb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: auto-update-conda: true auto-activate-base: true miniconda-version: 'latest' - python-version: "3.12" + python-version: "3.13" environment-file: environment.yml activate-environment: quantecon - name: Install JAX, Numpyro, PyTorch diff --git a/environment.yml b/environment.yml index 203de148f..80b64d6ac 100644 --- a/environment.yml +++ b/environment.yml @@ -2,17 +2,18 @@ name: quantecon channels: - default dependencies: - - python=3.12 - - anaconda=2024.10 + - python=3.13 + - anaconda=2025.06 - pip - pip: - - jupyter-book==1.0.3 - - quantecon-book-theme==0.7.6 - - sphinx-tojupyter==0.3.0 + - jupyter-book==1.0.4post1 + - quantecon-book-theme==0.8.3 + - sphinx-tojupyter==0.3.1 - sphinxext-rediraffe==0.2.7 - - sphinx-reredirects==0.1.4 - sphinx-exercise==1.0.1 - - sphinx-proof==0.2.0 - - ghp-import==1.1.0 - - sphinxcontrib-youtube==1.3.0 #Version 1.3.0 is required as quantecon-book-theme is only compatible with sphinx<=5 + - sphinx-proof==0.2.1 + - sphinxcontrib-youtube==1.4.1 - sphinx-togglebutton==0.3.2 + - sphinx-reredirects==0.1.4 + + From f110f6d309e0afe4d87ebc1a3a31227ab360b413 Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 30 Jul 2025 11:32:31 +1000 Subject: [PATCH 2/6] FIX: figure -> image directive in excercises --- lectures/career.md | 3 ++- lectures/finite_markov.md | 3 ++- lectures/ifp.md | 3 ++- lectures/kalman.md | 9 ++++++--- lectures/likelihood_bayes.md | 2 +- lectures/markov_perf.md | 6 ++++-- lectures/ols.md | 4 ++-- lectures/optgrowth_fast.md | 3 ++- lectures/pandas_panel.md | 2 +- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/lectures/career.md b/lectures/career.md index e2446cad1..d02dabd69 100644 --- a/lectures/career.md +++ b/lectures/career.md @@ -370,7 +370,8 @@ when the worker follows the optimal policy. In particular, modulo randomness, reproduce the following figure (where the horizontal axis represents time) -```{figure} /_static/lecture_specific/career/career_solutions_ex1_py.png +```{image} /_static/lecture_specific/career/career_solutions_ex1_py.png +:align: center ``` ```{hint} diff --git a/lectures/finite_markov.md b/lectures/finite_markov.md index 924358069..7a7e35b48 100644 --- a/lectures/finite_markov.md +++ b/lectures/finite_markov.md @@ -1113,7 +1113,8 @@ is known as [PageRank](https://en.wikipedia.org/wiki/PageRank). To illustrate the idea, consider the following diagram -```{figure} /_static/lecture_specific/finite_markov/web_graph.png +```{image} /_static/lecture_specific/finite_markov/web_graph.png +:align: center ``` Imagine that this is a miniature version of the WWW, with diff --git a/lectures/ifp.md b/lectures/ifp.md index 6b4906db3..e67865b2e 100644 --- a/lectures/ifp.md +++ b/lectures/ifp.md @@ -548,7 +548,8 @@ Let's consider how the interest rate affects consumption. Reproduce the following figure, which shows (approximately) optimal consumption policies for different interest rates -```{figure} /_static/lecture_specific/ifp/ifp_policies.png +```{image} /_static/lecture_specific/ifp/ifp_policies.png +:align: center ``` * Other than `r`, all parameters are at their default values. diff --git a/lectures/kalman.md b/lectures/kalman.md index cc468acc0..9f87bbb76 100644 --- a/lectures/kalman.md +++ b/lectures/kalman.md @@ -565,7 +565,8 @@ In the simulation, take $\theta = 10$, $\hat x_0 = 8$ and $\Sigma_0 = 1$. Your figure should -- modulo randomness -- look something like this -```{figure} /_static/lecture_specific/kalman/kl_ex1_fig.png +```{image} /_static/lecture_specific/kalman/kl_ex1_fig.png +:align: center ``` ```{exercise-end} @@ -629,7 +630,8 @@ Plot $z_t$ against $T$, setting $\epsilon = 0.1$ and $T = 600$. Your figure should show error erratically declining something like this -```{figure} /_static/lecture_specific/kalman/kl_ex2_fig.png +```{image} /_static/lecture_specific/kalman/kl_ex2_fig.png +:align: center ``` ```{exercise-end} @@ -732,7 +734,8 @@ Finally, set $x_0 = (0, 0)$. You should end up with a figure similar to the following (modulo randomness) -```{figure} /_static/lecture_specific/kalman/kalman_ex3.png +```{image} /_static/lecture_specific/kalman/kalman_ex3.png +:align: center ``` Observe how, after an initial learning period, the Kalman filter performs quite well, even relative to the competitor who predicts optimally with knowledge of the latent state. diff --git a/lectures/likelihood_bayes.md b/lectures/likelihood_bayes.md index 0f2211f06..323206809 100644 --- a/lectures/likelihood_bayes.md +++ b/lectures/likelihood_bayes.md @@ -606,7 +606,7 @@ A correct Bayesian approach should directly model the uncertainty about $x$ and Here is the algorithm: -First we specify a prior distribution for $x$ given by $x \sim \text{Beta}(\alpha_0, \beta_0)$ with sexpectation $\mathbb{E}[x] = \frac{\alpha_0}{\alpha_0 + \beta_0}$. +First we specify a prior distribution for $x$ given by $x \sim \text{Beta}(\alpha_0, \beta_0)$ with expectation $\mathbb{E}[x] = \frac{\alpha_0}{\alpha_0 + \beta_0}$. The likelihood for a single observation $w_t$ is $p(w_t|x) = x f(w_t) + (1-x) g(w_t)$. diff --git a/lectures/markov_perf.md b/lectures/markov_perf.md index f4e0a4f24..06a929760 100644 --- a/lectures/markov_perf.md +++ b/lectures/markov_perf.md @@ -722,7 +722,8 @@ c1 = c2 = np.array([1, -2, 1]) e1 = e2 = np.array([10, 10, 3]) ``` -```{figure} /_static/lecture_specific/markov_perf/judd_fig2.png +```{image} /_static/lecture_specific/markov_perf/judd_fig2.png +:align: center ``` Inventories trend to a common steady state. @@ -731,7 +732,8 @@ If we increase the depreciation rate to $\delta = 0.05$, then we expect steady s This is indeed the case, as the next figure shows -```{figure} /_static/lecture_specific/markov_perf/judd_fig1.png +```{image} /_static/lecture_specific/markov_perf/judd_fig1.png +:align: center ``` In this exercise, reproduce the figure when $\delta = 0.02$. diff --git a/lectures/ols.md b/lectures/ols.md index 51497a664..736cbcf19 100644 --- a/lectures/ols.md +++ b/lectures/ols.md @@ -604,7 +604,7 @@ results. ```{code-cell} python3 # Load in data -df4 = pd.read_stata('https://github.com/QuantEcon/lecture-python/blob/master/source/_static/lecture_specific/ols/maketable4.dta?raw=true') +df4 = pd.read_stata('https://github.com/QuantEcon/lecture-python.myst/raw/refs/heads/main/lectures/_static/lecture_specific/ols/maketable4.dta') # Add a constant term df4['const'] = 1 @@ -677,7 +677,7 @@ using `numpy` - your results should be the same as those in the ```{code-cell} python3 # Load in data -df1 = pd.read_stata('https://github.com/QuantEcon/lecture-python/blob/master/source/_static/lecture_specific/ols/maketable1.dta?raw=true') +df1 = pd.read_stata('https://github.com/QuantEcon/lecture-python.myst/raw/refs/heads/main/lectures/_static/lecture_specific/ols/maketable1.dta') df1 = df1.dropna(subset=['logpgp95', 'avexpr']) # Add a constant term diff --git a/lectures/optgrowth_fast.md b/lectures/optgrowth_fast.md index 514fa12b6..c63bf9038 100644 --- a/lectures/optgrowth_fast.md +++ b/lectures/optgrowth_fast.md @@ -344,7 +344,8 @@ $$ The next figure shows a simulation of 100 elements of this sequence for three different discount factors (and hence three different policies). -```{figure} /_static/lecture_specific/optgrowth/solution_og_ex2.png +```{image} /_static/lecture_specific/optgrowth/solution_og_ex2.png +:align: center ``` In each sequence, the initial condition is $y_0 = 0.1$. diff --git a/lectures/pandas_panel.md b/lectures/pandas_panel.md index 664545b81..39c678478 100644 --- a/lectures/pandas_panel.md +++ b/lectures/pandas_panel.md @@ -502,7 +502,7 @@ in Europe by age and sex from [Eurostat](https://ec.europa.eu/eurostat/data/data The dataset can be accessed with the following link: ```{code-cell} ipython3 -url3 = 'https://raw.githubusercontent.com/QuantEcon/lecture-python/master/source/_static/lecture_specific/pandas_panel/employ.csv' +url3 = 'https://github.com/QuantEcon/lecture-python.myst/raw/refs/heads/main/lectures/_static/lecture_specific/pandas_panel/employ.csv' ``` Reading in the CSV file returns a panel dataset in long format. Use `.pivot_table()` to construct From 9f1adc20441030c71f699d9697dd1cd2d6c86330 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 28 Aug 2025 09:30:10 +1000 Subject: [PATCH 3/6] tmp: disable build cache full execution run --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33846cf40..c6bec2f7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,13 +35,13 @@ jobs: - name: Display Pip Versions shell: bash -l {0} run: pip list - - name: Download "build" folder (cache) - uses: dawidd6/action-download-artifact@v11 - with: - workflow: cache.yml - branch: main - name: build-cache - path: _build + # - name: Download "build" folder (cache) + # uses: dawidd6/action-download-artifact@v11 + # with: + # workflow: cache.yml + # branch: main + # name: build-cache + # path: _build # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build Download Notebooks (sphinx-tojupyter) shell: bash -l {0} From 4200476b8c349e1bf9d26670b0ba13b164e27a43 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 28 Aug 2025 09:31:11 +1000 Subject: [PATCH 4/6] upgrade quantecon==0.10.0 --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 80b64d6ac..86b0477df 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ dependencies: - pip - pip: - jupyter-book==1.0.4post1 - - quantecon-book-theme==0.8.3 + - quantecon-book-theme==0.10.0 - sphinx-tojupyter==0.3.1 - sphinxext-rediraffe==0.2.7 - sphinx-exercise==1.0.1 From 4727d779784afbec162f8eabfc72a252e37c389f Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 28 Aug 2025 09:38:16 +1000 Subject: [PATCH 5/6] upgrade quantecon-book-theme=0.9.0 x quantecon==0.10.0 (lecture install) --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 86b0477df..c7bcae32d 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ dependencies: - pip - pip: - jupyter-book==1.0.4post1 - - quantecon-book-theme==0.10.0 + - quantecon-book-theme==0.9.0 - sphinx-tojupyter==0.3.1 - sphinxext-rediraffe==0.2.7 - sphinx-exercise==1.0.1 From f7e1bdf200812bfc9a414eae147524b3c4bd4c68 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 28 Aug 2025 14:15:41 +1000 Subject: [PATCH 6/6] Revert "tmp: disable build cache full execution run" This reverts commit 9f1adc20441030c71f699d9697dd1cd2d6c86330. --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 229259baf..258e56ee1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,13 +35,13 @@ jobs: - name: Display Pip Versions shell: bash -l {0} run: pip list - # - name: Download "build" folder (cache) - # uses: dawidd6/action-download-artifact@v11 - # with: - # workflow: cache.yml - # branch: main - # name: build-cache - # path: _build + - name: Download "build" folder (cache) + uses: dawidd6/action-download-artifact@v11 + with: + workflow: cache.yml + branch: main + name: build-cache + path: _build # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build Download Notebooks (sphinx-tojupyter) shell: bash -l {0}