Skip to content

🌐 [translation-sync] [qr_decomp.md] Update np.random → Generator API - #219

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-20-39-pr-999
Open

🌐 [translation-sync] [qr_decomp.md] Update np.random → Generator API#219
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-20-39-pr-999

Conversation

@mmcky

@mmcky mmcky commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

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

Source PR

#999 - [qr_decomp.md] Update np.random → Generator API

Files Updated

  • ✏️ lectures/qr_decomp.md
  • ✏️ .translate/state/qr_decomp.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 requested review from Copilot July 31, 2026 23:20
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Jul 31, 2026
@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit 91a67e4
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6d2dcc1f441d0008060623
😎 Deploy Preview https://deploy-preview-219--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-31
Routing: auto-merge — no gating findings; floors met


📝 Translation Quality

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

Summary: 本次PR涉及的三个章节(一些代码、使用QR分解计算特征值、QR分解与PCA)翻译准确、流畅,术语使用规范,代码和公式格式完整无误。仅存在个别措辞可进一步优化的细微问题,不影响整体理解。 代码块和数学公式格式完整保留,未破坏LaTeX或代码语法 术语翻译(如'格拉姆-施密特正交化'、'特征值'、'主成分分析')符合术语表要求且前后一致 标题翻译准确对应YAML frontmatter中的映射

Suggestions:

  • [minor · fluency] lectures/qr_decomp.md — ## $QR$ 和 PCA - point 5: 英文原文使用 'It will turn out that' 表达一种即将展示/证明的结果,译文'我们应该会发现'带有一定推测/不确定语气,与原意(后续会通过代码验证得出该结论)略有偏差 → 将'我们应该会发现'改为'结果表明'或'可以验证'
  • [nit · fluency] lectures/qr_decomp.md — ## 一些代码: '前面的代码没问题'略显口语化,可考虑更正式的学术表达 → '前面的代码是可行的' 或 '上述代码运行良好'

🔍 Diff Quality

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

Summary: The RNG modernization changes (adding rng = np.random.default_rng() and replacing np.random.* calls with rng.* calls) were correctly and completely mirrored in the same code cells and sections of the Chinese translation.


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 qr_decomp lecture to align with upstream changes that migrate random-number generation from the legacy np.random.* API to NumPy’s Generator API.

Changes:

  • Introduces a rng = np.random.default_rng() instance in lectures/qr_decomp.md.
  • Replaces usages of np.random.random / np.random.multivariate_normal with rng.random / rng.multivariate_normal.
  • Updates translation sync state metadata to the new upstream source SHA and tooling/version info.

Reviewed changes

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

File Description
lectures/qr_decomp.md Switches random draws to Generator (default_rng) and updates call sites accordingly.
.translate/state/qr_decomp.md.yml Updates translation-sync bookkeeping (source SHA, synced date, mode, tool version).

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

Comment thread lectures/qr_decomp.md
Comment on lines 397 to +398
# 生成一些随机矩
𝜇 = np.random.random(size=k)
C = np.random.random((k, k))
𝜇 = rng.random(size=k)
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 1, 2026 00:02 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