[action-translation] resync: imp_sample.md#116
Conversation
✅ Deploy Preview for astonishing-narwhal-a8fc64 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR forward-resyncs the Chinese translation of imp_sample.md against the upstream source commit b8ed85c, bringing the translated lecture back in line with the source content and updating translation sync metadata.
Changes:
- Added
translation:frontmatter metadata (title + heading mapping) tolectures/imp_sample.md. - Removed the
@jit(parallel=True)decorator andprangeusage from thesimulateloop to match the upstream source behavior. - Added translation state tracking for this file under
.translate/state/.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lectures/imp_sample.md | Resynced lecture translation; adds translation frontmatter and aligns the simulate implementation with the upstream source. |
| .translate/state/imp_sample.md.yml | Records source SHA, sync date, model, and resync mode for translation tracking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The resync kept the CJK font-configuration block but dropped the mpl import it depends on - a NameError at execution that non-strict builds swallow. Found sweeping the wave for the pattern behind zh-cn#97's December fixes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…anslation#116) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-19 📝 Translation Quality
Summary: 整体翻译质量优秀,准确传达了原文关于似然比过程均值和重要性抽样的技术内容,术语使用规范一致,数学公式和代码结构完整保留。主要问题集中在文档后半部分(选择抽样分布章节)出现的英文半角标点符号,与前文中文全角标点不一致,建议统一修正。 数学公式和LaTeX符号完整保留,未出现渲染问题 专业术语翻译准确,如'重要性抽样'、'似然比'、'累积似然比'等均符合术语表标准 代码块结构和缩进完整保留,仅代码注释被恰当翻译 长句拆分处理得当,保持了学术文本的严谨性和可读性 Suggestions:
🔍 Diff Quality
Summary: The target correctly adds translation metadata mapping all headings, fixes a code bug (missing matplotlib import) and removes an erroneous jit/prange decoration on simulate that had crept into the target, aligning it with the source structure and content. This review was generated automatically by action-translation review mode. |
…#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>
* FIX: execution and doc failures from the Anaconda 2026.07 cache build 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> * CI: align build safety with the English source repo Resolves #184. Brings ci.yml's execution safety in line with lecture-python.myst, which is the standard the fleet builds to. - `-n -W --keep-going` on the sphinx-tojupyter build. Previously this step ran with no flags, so a notebook whose cells raised still exited zero and the job went green. That is how the two execution breaks in #182 (likelihood_bayes, kalman_2) reached main with passing CI. - Upload Execution Reports (Download Notebooks), so a failure in that step leaves a traceback artifact. Previously there was none, which is why #182 had to be diagnosed from the weekly Build Cache workflow's artifact rather than from CI directly. - Clear stale Sphinx environment (`rm -rf _build/.doctrees`) before the builds, matching the source repo. The equivalent was present here only as a commented-out note. The HTML artifact is renamed `execution-reports` -> `execution-reports-html`. This is required, not cosmetic: upload-artifact@v7 runs with `overwrite: false`, so adding a second upload under the same name would collide when both steps fail in one run. The new names match the source repo's convention (-notebooks / -latex / -html). The PDF/LaTeX build is left commented out — see the issue for why that one needs a human decision rather than mechanical alignment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * CI: set -eo pipefail on the sphinx-tojupyter step Addresses Copilot review feedback on #185. `shell: bash -l {0}` is a custom shell spec, so GitHub does not inject `-eo pipefail` — it only does that for the bare `shell: bash` shorthand, which expands to `bash --noprofile --norc -eo pipefail {0}`. Without it, this step's exit code is that of the trailing `cp`, so a failing `jb build` was masked. `--keep-going` made that worse rather than better: it forces Sphinx to emit output despite the errors, so the .ipynb files exist, `cp` succeeds, and the step goes green. The flag added in this PR to surface failures was producing the artifacts that hid them. Scope is exactly one step — an audit of ci.yml shows every other step is either single-command (its exit code is the command's) or uses the default shell, which does carry `-e`. Note the English source repo lecture-python.myst has the byte-identical pattern, so this is inherited from the standard rather than introduced here, and it deviates from the strict parity this PR set out to establish. Reported upstream so the standard can catch up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Forward Resync: imp_sample.md
Source: QuantEcon/lecture-python.myst — lectures/imp_sample.md
Source commit:
b8ed85cThis PR resyncs the translation to match the current source document.
Reason: Target adds font configuration code (FONTPATH, mpl.font_manager, plt.rcParams) not in source, and adds @jit(parallel=True) decorator to the simulate function in target that is absent in source. These are code additions beyond simple i18n font config in one case (the @jit decorator change affects code logic), though the font config itself is typical i18n. Overall content is otherwise faithfully translated.
Changes
Whole-file resync applied. The entire document was resynced in a single pass.
Created by action-translation forward resync