Skip to content

🌐 [translation-sync] [scipy.md] Update np.random → Generator API#63

Open
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-08T09-34-26-pr-547
Open

🌐 [translation-sync] [scipy.md] Update np.random → Generator API#63
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-08T09-34-26-pr-547

Conversation

@mmcky
Copy link
Copy Markdown
Contributor

@mmcky mmcky commented May 8, 2026

Automated Translation Sync

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

Source PR

#547 - [scipy.md] Update np.random → Generator API

Files Updated

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

Details

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

This PR was created automatically by the translation action.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-4-6 | Date: 2026-05-08


📝 Translation Quality

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

Summary: The translation of the three modified sections (Random Variables and Distributions, Other Goodies in scipy.stats, and Exercises) is of high quality. Technical accuracy is strong, terminology follows the reference glossary, and MyST/Markdown formatting is well-preserved. Minor issues include a slight mismatch in register for the 'Other Goodies' section title and minor reordering in exercise instructions that slightly departs from the source structure. No syntax errors were detected. Technical terminology is consistently and accurately translated throughout the modified sections, including correct use of '对数正态分布', '蒙特卡洛', '大数定律', and '贴现因子' in the Exercises section The ### Random Variables and Distributions section is translated with high fidelity, preserving all mathematical notation, code comments, and the explanation of rv_frozen objects and loc/scale parameters ### Other Goodies in scipy.stats correctly translates the linear regression example and documentation link reference, maintaining the instructional flow of the original Formatting is well-preserved across all modified sections: MyST directives, code cells, math blocks, exercise/solution directives, and hints are all correctly maintained The Exercises section handles the multi-part structure (sp_ex01, sp_ex02, sp_ex03, sp_ex1) accurately, with solution blocks and hints properly translated and formatted

Suggestions:

  • Other Goodies in scipy.stats - Section title: 'scipy.stats 中的其他功能' is acceptable but could more closely mirror the colloquial tone of 'Goodies' → consider 'scipy.stats 中的其他实用功能' or 'scipy.stats 的其他亮点' to better capture the informal register of the original

  • Exercises - sp_ex02 exercise body: 'In order to get the option price, compute the integral of this function numerically using quad from scipy.integrate.' is translated implicitly without a complete sentence rendering → the Chinese omits a direct instruction phrasing; consider '为了得到期权价格,请使用 scipy.integrate 中的 quad 对该函数进行数值积分计算。' to fully match the instructional tone

  • Exercises - sp_ex03: 'Try to get a similar result using Monte Carlo to compute the expectation term' → translated as '尝试使用蒙特卡洛方法来计算期权价格中的期望项,而不是使用 quad,从而得到类似的结果。' which reorders the clause; a more natural rendering following source order: '尝试使用蒙特卡洛方法计算期权价格中的期望项,以得到类似结果,而非使用 quad。'


🔍 Diff Quality

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

Summary: All translation changes are correctly applied: code cells updated to use rng-based random generation, the 'functions' text updated, and the sp_ex03 solution updated, all in the correct positions matching the source document changes.


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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 scipy.md lecture to align with the upstream change from legacy np.random.* calls to the NumPy Generator API (default_rng()), and refreshes the translation sync state metadata accordingly.

Changes:

  • Replaced legacy np.random.* usage with rng = np.random.default_rng() and rng.* calls in examples.
  • Minor formatting adjustments in the lecture text (spacing around links/refs, code cell cleanup).
  • Updated .translate/state/scipy.md.yml sync metadata (source SHA, 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/scipy.md Updates lecture code examples to use NumPy’s Generator API for random number generation.
.translate/state/scipy.md.yml Updates translation sync state (source SHA, synced date, mode, tool version).

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

Comment thread lectures/scipy.md
Comment on lines 213 to 215
```{code-cell} python3
from scipy.stats import linregress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants