🌐 [translation-sync] [likelihood_ratio_process_2.md] Update np.random → Generator API - #227
🌐 [translation-sync] [likelihood_ratio_process_2.md] Update np.random → Generator API#227mmcky 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: 翻译整体质量较高,准确传达了原文的经济学和数学概念,专业术语翻译规范。主要问题集中在模拟部分的代码注释和图表标签中存在中英文混杂及'agent'翻译不一致(个体/代理)的现象,属于风格统一性问题而非准确性错误。未发现严重的语法错误或数学公式损坏。 数学公式和代码块完整保留,未出现语法错误 专业术语(如似然比、贝叶斯更新、帕累托权重等)翻译准确,符合术语表 长句结构处理得当,保持了学术文本的严谨性和可读性 标题翻译与YAML frontmatter中的映射保持一致 Suggestions:
🔍 Diff Quality
Summary: The RNG refactoring (adding np.random.default_rng() and replacing np.random.beta/rand calls with rng.beta/rng.random) was correctly and completely mirrored in all corresponding code cells 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 lecture likelihood_ratio_process_2.md to use NumPy’s Generator API (np.random.default_rng() + rng.*) instead of the legacy np.random.* functions, keeping the zh-cn content aligned with upstream changes.
Changes:
- Introduces
rng = np.random.default_rng()and replacesnp.random.beta/randcalls withrng.beta/random. - Updates a simulation helper to draw randomness via the passed generator.
- Updates 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 1 comment.
| File | Description |
|---|---|
| lectures/likelihood_ratio_process_2.md | Switches lecture randomness from np.random.* to Generator (rng.*) across code cells. |
| .translate/state/likelihood_ratio_process_2.md.yml | Updates translation sync tracking metadata to the new source commit and tool version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -162,7 +164,7 @@ def simulate(a, b, T=50, N=500): | |||
|
|
|||
| for i in range(N): | |||
| for j in range(T): | |||
| w = np.random.beta(a, b) | |||
| w = rng.beta(a, b) | |||
Automated Translation Sync
This PR contains automated translations from QuantEcon/lecture-python.myst.
Source PR
#991 - [likelihood_ratio_process_2.md] Update np.random → Generator API
Files Updated
lectures/likelihood_ratio_process_2.md.translate/state/likelihood_ratio_process_2.md.ymlDetails
This PR was created automatically by the translation action.