From 7cd9274d1ef96cc9123cba72252b7d96e16f6537 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Sun, 18 Oct 2026 18:26:14 +1100 Subject: [PATCH 1/3] =?UTF-8?q?ak=5Faiyagari:=20finish=20the=20hh=20?= =?UTF-8?q?=E2=86=92=20household=20rename=20in=20the=20six=20cells=20the?= =?UTF-8?q?=202026-08-05=20sync=20never=20delivered?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit myst#706 renamed the household parameter from hh to household on 2026-08-05. Its sync run failed before it could file anything (the anthropic-api-key input was missing that night), so the rename never reached this edition. Today's #290 then synced myst#1078's cells, which use the new name, on top of the old one, and the lecture stopped executing. This brings the nine remaining code lines into line with the English; the lecture's code now has the same 56 hh and the same call sites as the source. Co-Authored-By: Claude Fable 5.1 --- lectures/ak_aiyagari.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lectures/ak_aiyagari.md b/lectures/ak_aiyagari.md index f99414cb..f8823c24 100644 --- a/lectures/ak_aiyagari.md +++ b/lectures/ak_aiyagari.md @@ -575,8 +575,8 @@ def popu_dist(σ, household, Q): j_grid, a_grid, γ_grid, Π, β, init_μ, VJ = household - J = hh.j_grid.size - num_state = hh.a_grid.size * hh.γ_grid.size + J = household.j_grid.size + num_state = household.a_grid.size * household.γ_grid.size def update_popu_j(μ_j, j): "更新从年龄j到j+1的人口分布" @@ -691,7 +691,7 @@ def compute_aggregates(μ, household): J, a_size, γ_size = j_grid.size, a_grid.size, γ_grid.size - μ = μ.reshape((J, hh.a_grid.size, hh.γ_grid.size)) + μ = μ.reshape((J, household.a_grid.size, household.γ_grid.size)) # 计算私人储蓄 a = a_grid.reshape((1, a_size, 1)) @@ -758,13 +758,13 @@ def find_ss(household, firm, pol_target, Q, tol=1e-6, max_iter=200): r_old, w_old = r, w # 家庭最优决策和价值 - V, σ = backwards_opt([r, w], [τ, δ], hh, Q) + V, σ = backwards_opt([r, w], [τ, δ], household, Q) # 计算稳态分布 - μ = popu_dist(σ, hh, Q) + μ = popu_dist(σ, household, Q) # 计算总量 - A, L = compute_aggregates(μ, hh) + A, L = compute_aggregates(μ, household) K = A - D # 更新价格 @@ -928,8 +928,8 @@ def population_evolution(σt, μt, household, Q): j_grid, a_grid, γ_grid, Π, β, init_μ, VJ = household - J = hh.j_grid.size - num_state = hh.a_grid.size * hh.γ_grid.size + J = household.j_grid.size + num_state = household.a_grid.size * household.γ_grid.size def population_evolution_j(j): @@ -1066,7 +1066,7 @@ def path_iteration(ss1, ss2, pol_target, household, firm, Q, tol=1e-4, # 向后求解最优政策 V_seq, σ_seq = solve_backwards( - V_ss2, σ_ss2, hh, firm, price_seq, pol_seq, Q) + V_ss2, σ_ss2, household, firm, price_seq, pol_seq, Q) # 向前计算人口演变 μ_seq, K_seq, L_seq = simulate_forwards( From 40d0eb179f13889efdc0b41d94e77ba028b167b6 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Sun, 18 Oct 2026 18:26:14 +1100 Subject: [PATCH 2/3] _config: map the programming intersphinx key to the zh-cn programming edition linear_algebra (#280, synced from myst#1054) now carries four {doc}/{ref} targets under the programming: key the English config defines. This edition only had pyprog:, so the build reported four unknown-document warnings, which -W turns into a failure. The zh-cn programming site carries the three labels (numpy_array, numpy_shape_dim, creating_arrays), so the key points there. Co-Authored-By: Claude Fable 5.1 --- lectures/_config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index 4731c054..7d360f08 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -130,6 +130,9 @@ sphinx: jax: - "https://jax.quantecon.org/" - null + programming: + - "https://quantecon.github.io/lecture-python-programming.zh-cn/" + - null mathjax3_config: tex: macros: From ffa45ad0925541aa48ad31bf5e91d819c8ec7d25 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Sun, 18 Oct 2026 18:33:29 +1100 Subject: [PATCH 3/3] environment: install jax 0.11.0, since two lectures skip their own install cell Every other JAX lecture in this edition installs JAX at run time through a !pip install cell that executes. ak_aiyagari and two_computation carry that cell tagged skip-execution, as the English does, because the English runner preinstalls jax[cuda13]. This CI preinstalled nothing, so both lectures failed on import jax. Pinned at 0.11.0 for the lax.fori_loop regression in 0.11.1 (QuantEcon/workspace-lectures#49); the unpinned install cells then leave it in place. Co-Authored-By: Claude Fable 5.1 --- environment.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 599ece0d..22523a16 100644 --- a/environment.yml +++ b/environment.yml @@ -15,5 +15,7 @@ dependencies: - sphinxcontrib-youtube==1.5.0 - sphinx-togglebutton==0.4.5 - sphinx-reredirects==1.1.0 - - + # Pinned: jax 0.11.1 hangs lax.fori_loop on the CPU path (QuantEcon/workspace-lectures#49), + # and two lectures (ak_aiyagari, two_computation) skip their own `!pip install jax` cell + # because the English runner preinstalls JAX; this CI has to as well. + - jax==0.11.0