Skip to content

Commit ebdf378

Browse files
mmckyclaude
andauthored
FIX: execution and doc failures from the Anaconda 2026.07 cache build (#183)
Resolves the four failures reported in #182. All four are target-side defects; the English source is healthy in every case. likelihood_bayes — the font block called `mpl.font_manager.fontManager` and `plt.rcParams` before `import matplotlib.pyplot as plt`. Newer matplotlib no longer imports `font_manager` as a side effect of `import matplotlib`, so this raised AttributeError (and would have raised NameError on `plt`). Moved the pyplot import above both uses. An audit of the font block across all 69 lectures found this the only file with either ordering hazard. kalman_2 — a `.text()` annotation drew the covariance matrix with `\begin{bmatrix}`, which matplotlib mathtext cannot render (it supports no LaTeX environments). Rewritten as `\left[ \substack{...} \right]`, which renders an equivalent bracketed 2x2 matrix under mathtext, using `\;` as the column separator rather than `&`. This keeps the drop-usetex standard from #22 intact with no loss of information. The lecture's other `\begin{bmatrix}` uses are inside `{math}` blocks, rendered by MathJax, and are unaffected. sir_model — the header directive had lost its argument: `{raw}` instead of `{raw} jupyter`. The other 50 lectures carrying this directive kept theirs. ak_aiyagari — the file carried a stray fence at line 38 followed by a duplicated copy of the original frontmatter, and a doubled closing fence at EOF. The stray opener ran to line 56, swallowing both the H1 title and the `_admonition/gpu.md` include, which is what produced the 13 "headings start at H2" warnings. Removed both strays; the file's fence structure now matches the English source exactly (122). The `translation.title` field was also corrupt ("V, σ, μ") and has been set to the lecture title. An edition-wide sweep found no other file with unbalanced fences. The last two are content corruption introduced in translation and warrant engine issues against action-translation; they are not covered by the existing #107/#115/#116/#117 set. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 39bda65 commit ebdf378

4 files changed

Lines changed: 5 additions & 21 deletions

File tree

lectures/ak_aiyagari.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ kernelspec:
1010
language: python
1111
name: python3
1212
translation:
13-
title: V, σ, μ
13+
title: 长寿、异质性个体、世代交叠模型
1414
headings:
1515
Overview: 概述
1616
Environment: 经济环境
@@ -35,21 +35,6 @@ translation:
3535
'Experiment 2: Preannounced tax cut': 实验2:预先宣布的减税
3636
---
3737

38-
```
39-
---
40-
jupytext:
41-
text_representation:
42-
extension: .md
43-
format_name: myst
44-
format_version: 0.13
45-
jupytext_version: 1.17.3
46-
kernelspec:
47-
display_name: Python 3 (ipykernel)
48-
language: python
49-
name: python3
50-
---
51-
52-
5338
# 长寿、异质性个体、世代交叠模型
5439

5540
```{include} _admonition/gpu.md
@@ -1477,4 +1462,3 @@ ax2.set_ylabel(r"j")
14771462
14781463
plt.show()
14791464
```
1480-
```

lectures/kalman_2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ for i, t in enumerate(np.linspace(0, T-1, 3, dtype=int)):
352352
axs[i].set_ylabel(r'$u_{{{}}}$'.format(str(t)))
353353
354354
cov_latex = (
355-
r'$\Sigma_{{{}}}= \begin{{bmatrix}} {:.2f} & {:.2f} \\ '
356-
r'{:.2f} & {:.2f} \end{{bmatrix}}$'
355+
r'$\Sigma_{{{}}}= \left[ \substack{{{:.2f} \; {:.2f} \\ '
356+
r'{:.2f} \; {:.2f}}} \right]$'
357357
).format(t, cov[0, 0], cov[0, 1], cov[1, 0], cov[1, 1])
358358
axs[i].text(0.33, -0.15, cov_latex, transform=axs[i].transAxes)
359359

lectures/likelihood_bayes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ translation:
6262
6363
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
6464
import matplotlib as mpl
65+
import matplotlib.pyplot as plt
6566
mpl.font_manager.fontManager.addfont(FONTPATH)
6667
plt.rcParams['font.family'] = ['Source Han Serif SC']
6768
68-
import matplotlib.pyplot as plt
6969
import numpy as np
7070
from numba import vectorize, jit, prange
7171
from math import gamma

lectures/sir_model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ translation:
2121
Ending Lockdown: 解除封锁
2222
---
2323

24-
```{raw}
24+
```{raw} jupyter
2525
<div id="qe-notebook-header" align="right" style="text-align:right;">
2626
<a href="https://quantecon.org/" title="quantecon.org">
2727
<img style="width:250px;display:inline;" width="250px" src="https://assets.quantecon.org/img/qe-menubar-logo.svg" alt="QuantEcon">

0 commit comments

Comments
 (0)