Skip to content

🌐 [translation-sync] FIX: seven source-side defects in python_by_example, functions, numpy and pandas - #86

Merged
mmcky merged 9 commits into
mainfrom
translation-sync-2026-08-05T02-42-54-pr-604
Aug 10, 2026
Merged

🌐 [translation-sync] FIX: seven source-side defects in python_by_example, functions, numpy and pandas#86
mmcky merged 9 commits into
mainfrom
translation-sync-2026-08-05T02-42-54-pr-604

Conversation

@mmcky

@mmcky mmcky commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

This PR contains automated translations from QuantEcon/lecture-python-programming.

Source PR

#604 - FIX: seven source-side defects in python_by_example, functions, numpy and pandas

Files Updated

  • ✏️ lectures/functions.md
  • ✏️ .translate/state/functions.md.yml
  • ✏️ lectures/numpy.md
  • ✏️ .translate/state/numpy.md.yml
  • ✏️ lectures/pandas.md
  • ✏️ .translate/state/pandas.md.yml
  • ✏️ lectures/python_by_example.md
  • ✏️ .translate/state/python_by_example.md.yml

Details

  • Source Language: en
  • Target Language: zh-cn
  • Model: claude-sonnet-5

This PR was created automatically by the translation action.

@mmcky mmcky added the action-translation PRs created by QuantEcon/action-translation label Aug 5, 2026
Copilot AI lite review requested due to automatic review settings August 5, 2026 02:43
@mmcky mmcky added automated Automated sync PR opened by action-translation action-translation PRs created by QuantEcon/action-translation labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-10
Routing: editor — 1 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other)
Shadow gate: would NOT auto-merge (recorded only; no action taken)


📝 Translation Quality

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

Summary: 本次修改涉及的章节(概述、随机抽取、递归函数调用、创建数组、DataFrames 修改、requests 访问数据、While 循环、练习等)翻译质量整体优秀,术语使用准确一致,格式和代码块保持完好,未发现阻断性或重大错误,仅有少量措辞可以进一步优化以提升自然度。 专业术语翻译准确一致,符合术语表要求(如'广播'、'矩阵乘法'、'马尔可夫链'等未直接出现但风格一致) 代码块、数学公式、MyST 指令等格式完整保留,未破坏原有结构 长段落的技术说明翻译流畅,逻辑清晰,符合学术文本的中文表达习惯 标题翻译准确且与 translation.headings 元数据一致

Suggestions:

  • [minor · fluency] lectures/functions.md — ### 随机抽取 / Applications section intro: 英文原文中 '### Random Draws' 部分开头有一句解释性文字被省略:'This is accomplished in the next program' 前的上下文翻译基本完整,但个别过渡句略显生硬,例如 '这在下一个程序中实现' 读起来比英文稍显直译。 → 可考虑译为 '下面的程序实现了这一点' 以更符合中文表达习惯。
  • [minor · terminology] lectures/pandas.md — ### 修改 DataFrames / apply/map examples: 变量名 'population'、'total GDP' 等被保留为英文而未翻译(如 df.columns = 'population', 'total GDP'),这是代码字符串字面量,保留英文是合理的,但周围叙述文字中出现了中英混杂(例如 '让我们给列取更好的名称' 后紧跟英文列名字符串),整体可接受,但可以在文中加注说明该列名仍为英文字符串。
  • [nit · fluency] lectures/numpy.md — ### 隐式多线程: '我们可以看到 8 个 CPU 中有 4 个在全速运行' 翻译准确,但稍显直译,可以更自然地表达为 '可以看到 8 个 CPU 核心中有 4 个正在满速运行'。 → 可以看到 8 个 CPU 核心中有 4 个正在满速运行。

🔍 Diff Quality

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

Summary: All source content changes (FILO→LIFO wording, isinstance/pd.isna refactors, requests wording tweak, minor phrasing fixes) are correctly and positionally mirrored in the target Chinese document with structure and translation heading-maps intact.

Issues:

  • functions.md: 'a First In Last Out (FILO) queue' translated to '一种后进先出(LIFO)数据结构' - the English source text itself appears unchanged in the 'before' vs 'after' diff shown (FILO->LIFO change happened in English source too), and Chinese correctly reflects LIFO as 后进先出, consistent with source correction.
  • pandas.md: source changed 'type(x)!=str' to 'not isinstance(x, str)' and 'np.isnan(x)' to 'pd.isna(x)' in two locations; target correctly mirrors both code changes.
  • pandas.md: source changed wording about accessing 'source' object; target correctly mirrors updated phrasing in Chinese.
  • No missed files: only functions.md, numpy.md, pandas.md, python_by_example.md changed in both source and target, matching the Files Changed list.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 syncs the zh-cn lecture translations with upstream fixes from QuantEcon/lecture-python-programming#604, updating wording and code snippets in several lectures plus the translation state metadata to reflect the new source commit.

Changes:

  • Corrects/clarifies translated explanations and headings in multiple lecture markdown files.
  • Updates pandas code examples to use isinstance(..., str) and pd.isna(...) for more robust missing-value handling.
  • Bumps translation sync state (source-sha, synced-at, model, tool-version) for the affected pages.

Reviewed changes

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

Show a summary per file
File Description
lectures/python_by_example.md Clarifies while loop explanation and uses consistent inline-code formatting.
lectures/pandas.md Improves robustness of examples (type checking via isinstance, missing checks via pd.isna) and generalizes requests narrative to use url.
lectures/numpy.md Fixes class name reference (DiscreteRV) and standardizes section labels (“第 1/2 部分”).
lectures/functions.md Removes an extra blank line and corrects stack description to LIFO terminology.
.translate/state/python_by_example.md.yml Updates translation sync metadata (source SHA/date/model/tool version).
.translate/state/pandas.md.yml Updates translation sync metadata (source SHA/date/model/tool version).
.translate/state/numpy.md.yml Updates translation sync metadata (source SHA/date/model/tool version).
.translate/state/functions.md.yml Updates translation sync metadata (source SHA/date/model/tool version).

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

Upstream QuantEcon/lecture-python-programming#604 added a space *after*
the `---` marker at this line. The sync mirrored that as a space *before*
the full-width `——`, which Chinese typography does not take — 100 of the
102 `——` uses under lectures/ have no space before them, and this line
was already correct before the sync.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mmcky

mmcky commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed the editor-routed finding and verified the full diff against upstream QuantEcon/lecture-python-programming#604 item by item. All seven source-side fixes are carried faithfully, and the two English-only items (it'sits, NumpyNumPy) are correctly left untranslated.

One fix-up pushed in dbb47f5: upstream added a space after its --- marker in numpy.md; the sync mirrored it as a space before the full-width ——, which Chinese typography does not take. 100 of the 102 —— uses under lectures/ have no space before them, and the line was already correct pre-sync, so it is reverted to `np.loadtxt`——详情.

The blank-line removal after ## 应用 in functions.md is intentional and correct — upstream has one blank line there, main had two.

The three review suggestions (整体地修改行/列, 拆分为两部分, and the requests heading note the reviewer itself retracted) are stylistic preferences on already-acceptable phrasing; leaving them as-is.

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 automated Automated sync PR opened by action-translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants