Skip to content

🌐 [translation-sync] [two_auctions.md] Update np.random → Generator API - #211

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-28T20-35-54-pr-960
Open

🌐 [translation-sync] [two_auctions.md] Update np.random → Generator API#211
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-28T20-35-54-pr-960

Conversation

@mmcky

@mmcky mmcky commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

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

Source PR

#960 - [two_auctions.md] Update np.random → Generator API

Files Updated

  • ✏️ lectures/two_auctions.md
  • ✏️ .translate/state/two_auctions.md.yml

Details

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

This PR was created automatically by the translation action.

Copilot AI review requested due to automatic review settings July 28, 2026 20:35
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Jul 28, 2026
@netlify

netlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit e7c4f0b
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6912b0a825cb00081cb486
😎 Deploy Preview https://deploy-preview-211--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.

@github-actions

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-28
Routing: editor — 1 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other); terminology 8 below floor 9


📝 Translation Quality

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

Summary: 翻译整体质量较高,准确传达了原文关于一价和二价拍卖的经济学概念、数学推导和Python代码逻辑,术语使用基本规范且与术语表保持一致。主要问题集中在代码注释的双语重复处理略显冗余,以及部分标题中'一价/二价'与'第一价格/第二价格'表述交替使用可能造成轻微的术语不统一,但均属于次要问题,不影响读者理解核心内容。 数学公式、LaTeX 标记和代码块结构完整保留,未破坏 MyST 语法 专业术语(如贝叶斯纳什均衡、收益等价定理、密封投标拍卖)翻译准确且大体符合术语表 表格内容翻译清晰,保留了原文的逻辑结构和对比关系 标点符号基本遵循全角中文标点规范

Suggestions:

  • [minor · terminology] lectures/two_auctions.md — Python code section, code comments: 许多原本为纯代码注释(英文)的行在翻译文档中被追加了中文翻译,形成'英文注释 # 中文翻译'的重复格式(例如 '# Bidders' values are sorted in ascending order... idx = np.argsort(v, axis=0) # 在每次拍卖中,竞买人的估值按升序排列。')。这种双重注释在代码单元格中显得冗余,虽不影响运行,但不符合简洁的代码注释翻译惯例,且部分位置英文注释与中文翻译顺序颠倒,读起来略显混乱。 → 统一将代码注释翻译为中文并替换原文,而不是保留英文原文再附加中文翻译,例如直接使用 '# 在每次拍卖中,竞买人的估值按升序排列。' 替代原英文注释。
  • [minor · fluency] lectures/two_auctions.md — ## Python code, imports: 新增的字体设置代码块(FONTPATH、mpl.font_manager等)没有任何注释说明其用途,虽然这是常见的中文字体渲染配置,但与英文原文相比属于新增内容,建议至少保持代码注释风格一致(若其他类似代码块有中文注释,此处也应考虑添加简要说明,或保持无注释的一致性)。 → 可保持原样,因为这是技术性配置且不影响文本理解;若要与其他部分风格统一,可添加简短注释如 '# 设置中文字体以正确显示中文标签'。
  • [nit · fluency] lectures/two_auctions.md — ## Second price sealed bid auction: 标题翻译为'第二价格密封拍卖',但正文中提到'第二价格密封拍卖'与前文'二价密封拍卖(SPSB)'的表述在中文里略有不一致(一价/二价 vs 第一价格/第二价格),虽然两者均可理解,但混用可能造成术语不统一的印象。 → 统一使用'一价密封拍卖'和'二价密封拍卖'或者统一使用'第一价格密封拍卖'和'第二价格密封拍卖',避免两种表述交替出现。

🔍 Diff Quality

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

Summary: The RNG API migration (np.random.seed/np.random.X to rng = np.random.default_rng()/rng.X) and jupytext_version bump were correctly and completely mirrored in the target document at matching positions, with no unrelated changes.


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

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 automated translation-sync PR updates the Chinese two_auctions lecture to match upstream changes that migrate randomness from the legacy np.random.* global API to NumPy’s Generator API (default_rng), keeping randomness deterministic via a fixed seed.

Changes:

  • Replaced np.random.seed(...) + np.random.<dist>(...) usage with rng = np.random.default_rng(...) + rng.<dist>(...) in the lecture code cells.
  • Updated Jupytext metadata version in the lecture frontmatter.
  • Updated translation sync state metadata (source-sha, synced-at, mode, tool version).

Reviewed changes

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

File Description
lectures/two_auctions.md Switches random draws to a seeded Generator (rng) to align with upstream np.random → Generator migration.
.translate/state/two_auctions.md.yml Updates translation-sync bookkeeping to the new upstream source SHA and sync timestamp.

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

@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 28, 2026 21:17 Inactive
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