Skip to content

🌐 [translation-sync] [ar1_processes.md] Update np.random → Generator API - #282

Merged
mmcky merged 2 commits into
mainfrom
translation-sync-2026-08-03T19-43-35-pr-794
Aug 10, 2026
Merged

mmcky merged 2 commits into
mainfrom
translation-sync-2026-08-03T19-43-35-pr-794

Conversation

@mmcky

@mmcky mmcky commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

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

Source PR

#794 - [ar1_processes.md] Update np.random → Generator API

Files Updated

  • ✏️ lectures/ar1_processes.md
  • ✏️ .translate/state/ar1_processes.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 August 3, 2026 19:43
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Aug 3, 2026
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for playful-platypus-17d3bb ready!

Name Link
🔨 Latest commit 4960b9a
🔍 Latest deploy log https://app.netlify.com/projects/playful-platypus-17d3bb/deploys/6a70ef6b6d2aa7000816b4c5
😎 Deploy Preview https://deploy-preview-282--playful-platypus-17d3bb.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

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-03
Routing: editor — 1 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other)


📝 Translation Quality

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

Summary: 练习部分的翻译总体质量较高,数学内容和代码块保持完整准确,术语使用基本遵循术语表要求。存在的问题主要是次要的:分段函数中夹杂纯中文文字未使用 \text{} 包裹可能影响公式渲染的一致性;部分外部链接使用百度百科而非维基百科来源不统一;个别措辞可以更加自然流畅。整体不影响读者理解,属于可优化的细节问题。 练习部分的数学公式、代码块与原文结构保持高度一致,MyST 指令(exercise/solution)格式正确无误 术语翻译(如“核密度估计”“带宽”“贝塔分布”等)与术语表基本保持一致 长句拆分和被动语态转换处理得当,读起来符合中文学术写作习惯

Suggestions:

  • [minor · formatting] lectures/ar1_processes.md — Exercises > ar1p_ex1 solution, case block for M_k: 在数学的 cases 环境中混用了中文文字('如果 k 是奇数'/'如果 k 是偶数')与 LaTeX 排版,这会破坏公式内部排版的一致性;英文原文中该部分为 'if k is odd'/'if k is even',建议使用 \text{} 包裹翻译文本以保持公式渲染正确。 → 0 & \text{如果 } k \text{ 是奇数} \
    \sigma^k (k-1)!! & \text{如果 } k \text{ 是偶数}
  • [minor · terminology] lectures/ar1_processes.md — Exercises > ar1p_ex2, 核密度估计与贝塔分布链接: 术语表中未指定“核密度估计”和“贝塔分布”链接目标必须使用维基百科,但原文使用的是英文维基百科链接,译文改为百度百科链接,存在来源不一致的问题,且百度百科内容可能与英文版有出入,建议保持指向英文维基百科对应词条或中文维基百科版本以确保术语准确性与来源一致性。 → 将链接改为对应的中文维基百科页面,例如 https://zh.wikipedia.org/wiki/核密度估计https://zh.wikipedia.org/wiki/Β分布
  • [minor · fluency] lectures/ar1_processes.md — Exercises > ar1p_ex1 引言部分: “当 $m$ 是较大时”表达略显生硬,不符合中文习惯表达,原文为 'when m is large'。 → 改为“当 $m$ 较大时”
  • [nit · fluency] lectures/ar1_processes.md — Exercises > ar1p_ex3 说明第2步: “使用方程 $X_{t+1} = a X_t + b + c W_{t+1}$ 更新全部的数据”翻译稍显生硬,“全部的数据”不如“所有数据”自然。 → 使用规则 $X_{t+1} = a X_t + b + c W_{t+1}$ 更新所有数据

🔍 Diff Quality

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

Summary: The RNG API modernization (np.random.seed/randn to np.random.default_rng) was correctly synced into the target document's corresponding code cells without affecting unrelated content.


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

Syncs the zh-cn translation of ar1_processes.md with the upstream English lecture change that migrates examples from legacy np.random state to NumPy’s Generator API for random number generation.

Changes:

  • Update AR(1) moment-simulation example to accept a rng parameter and use rng.standard_normal() instead of np.random.seed / np.random.randn.
  • Update a later simulation snippet to use default_rng() + standard_normal() instead of np.random.randn.
  • Refresh translation-sync state metadata (source SHA, sync date, mode, tool version).

Reviewed changes

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

File Description
lectures/ar1_processes.md Migrates random draws in code cells to the NumPy Generator API to match upstream.
.translate/state/ar1_processes.md.yml Updates translation sync bookkeeping (source commit/date/mode/tool version).

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

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 3, 2026 19:49 Inactive
@mmcky
mmcky merged commit 2648132 into main Aug 10, 2026
10 of 11 checks passed
@mmcky
mmcky deleted the translation-sync-2026-08-03T19-43-35-pr-794 branch August 10, 2026 04:15
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