Skip to content

[action-translation] resync: inventory_dynamics.md#117

Merged
mmcky merged 2 commits into
mainfrom
resync/inventory_dynamics
Jul 19, 2026
Merged

[action-translation] resync: inventory_dynamics.md#117
mmcky merged 2 commits into
mainfrom
resync/inventory_dynamics

Conversation

@mmcky

@mmcky mmcky commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Forward Resync: inventory_dynamics.md

Source: QuantEcon/lecture-python.mystlectures/inventory_dynamics.md
Source commit: dba5555
This PR resyncs the translation to match the current source document.

Reason: The Chinese translation includes font-configuration code in the imports (i18n-related, acceptable), but also adds substantive content not in the source: an extra explanatory sentence after the shift_firms_forward solution ('从图中可以看出,随着时间的推移,分布逐渐收敛到一个稳定状态...'), expanded phrasing in several places, and extra hyperlinked terms (e.g. links added to '核密度估计' and '装饰器'). It also drops the index directive '{index} single: Markov process, inventory' present in source. These are substantive additions/omissions beyond pure localization.

Changes

Whole-file resync applied. The entire document was resynced in a single pass.


Created by action-translation forward resync

Copilot AI review requested due to automatic review settings July 18, 2026 07:40
@mmcky mmcky added action-translation-sync CLI resync PR (translate forward --github) resync Forward resync labels Jul 18, 2026
@netlify

netlify Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit eb9f0d0
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a5c4cc47093d30008680d54
😎 Deploy Preview https://deploy-preview-117--astonishing-narwhal-a8fc64.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR forward-resyncs the Chinese translation of inventory_dynamics.md to match the current upstream source document, and records the resync state for future automation.

Changes:

  • Added MyST front-matter translation metadata (title + heading mappings) and restored the {index} directive.
  • Updated various translated paragraphs/links to match upstream wording and formatting.
  • Added resync state metadata under .translate/state/ for traceability (source SHA, sync date, model, etc.).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lectures/inventory_dynamics.md Resynced translated lecture content; added translation metadata + index directive; updated phrasing/links and adjusted some code-cell markup.
.translate/state/inventory_dynamics.md.yml New resync state record pointing to the upstream source commit and sync metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

下面是一个类,它用于存储参数并生成库存的时间路径。

```{code-cell} ipython3
```{code-cell} python3
@@ -413,11 +423,11 @@ freq = compute_freq()
print(f"至少发生两次缺货的频率 = {freq}")
@mmcky mmcky added the action-translation PRs created by QuantEcon/action-translation label Jul 18, 2026
@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 18, 2026 10:30 Inactive
@github-actions

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-19


📝 Translation Quality

Criterion Score
Accuracy 9/10
Fluency 9/10
Terminology 9/10
Formatting 9/10
Overall 9/10

Summary: 整体翻译质量很高,准确传达了原文关于库存动态、马尔可夫过程和模拟方法的技术内容。术语使用规范一致,数学公式和代码结构完整保留。仅存在少量措辞冗余的小问题,不影响整体理解和专业性。 数学公式、代码块与LaTeX表达式完整保留,未出现任何格式损坏 专业术语翻译准确一致,如'核密度估计'、'边际分布'、'独立同分布'等均符合术语表标准 篇章结构、标题层级和练习/解答格式与原文完全对应 代码注释翻译准确且符合语境(如'记录补货2次或以上的公司数量')

Suggestions:

  • 概述部分: '我们的本节的目标是学习更多关于模拟、时间序列和马尔可夫动态的知识。' → 存在冗余措辞('我们的本节'),建议改为'本节的主要目标是学习更多关于模拟、时间序列和马尔可夫动态的知识。'
  • 导入代码部分: 原文只有简单的库导入代码,翻译中新增了字体设置代码(FONTPATH, mpl.font_manager等)及figure.figsize设置,这些是本地化渲染所需但并非原文内容,建议在评估中确认此为标准化模板而非翻译准确性问题

🔍 Diff Quality

Check Status
Scope Correct
Position Correct
Structure Preserved
Heading-map Correct
Overall 10/10

Summary: The target document's After version correctly matches the source structure, adds the translation metadata block with accurate heading mappings, and preserves all sections in the same relative order with only expected translation refinements.

Issues:

  • The {index} directive present in the source is missing from the target's Before but correctly restored/present in the After version
  • Minor translation wording changes (e.g., '这样可以更好地了解库存动态的整体行为和可能的库存分布' -> '从而更全面地了解不同结果的概率') appear to be resync refinements rather than errors, consistent with the whole-file resync context

This review was generated automatically by action-translation review mode.

@github-actions
github-actions Bot temporarily deployed to pull request July 19, 2026 04:28 Inactive
@mmcky
mmcky merged commit 7f6bf8c into main Jul 19, 2026
7 checks passed
@mmcky
mmcky deleted the resync/inventory_dynamics branch July 19, 2026 04:32
mmcky added a commit that referenced this pull request Jul 20, 2026
…#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>
mmcky added a commit that referenced this pull request Jul 20, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action-translation PRs created by QuantEcon/action-translation action-translation-sync CLI resync PR (translate forward --github) resync Forward resync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants