🌐 [translation-sync] [qr_decomp.md] Update np.random → Generator API - #219
🌐 [translation-sync] [qr_decomp.md] Update np.random → Generator API#219mmcky wants to merge 2 commits into
Conversation
✅ Deploy Preview for astonishing-narwhal-a8fc64 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-31 📝 Translation Quality
Summary: 本次PR涉及的三个章节(一些代码、使用QR分解计算特征值、QR分解与PCA)翻译准确、流畅,术语使用规范,代码和公式格式完整无误。仅存在个别措辞可进一步优化的细微问题,不影响整体理解。 代码块和数学公式格式完整保留,未破坏LaTeX或代码语法 术语翻译(如'格拉姆-施密特正交化'、'特征值'、'主成分分析')符合术语表要求且前后一致 标题翻译准确对应YAML frontmatter中的映射 Suggestions:
🔍 Diff Quality
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. |
There was a problem hiding this comment.
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 inlectures/qr_decomp.md. - Replaces usages of
np.random.random/np.random.multivariate_normalwithrng.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.
| # 生成一些随机矩 | ||
| 𝜇 = np.random.random(size=k) | ||
| C = np.random.random((k, k)) | ||
| 𝜇 = rng.random(size=k) |
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.ymlDetails
This PR was created automatically by the translation action.