🌐 [translation-sync] [functions.md] Update np.random → Generator API#61
🌐 [translation-sync] [functions.md] Update np.random → Generator API#61
Conversation
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-4-6 | Date: 2026-05-04 📝 Translation Quality
Summary: The translation of the modified sections (Random Draws, Adding Conditions, and Exercises) is of high quality. Technical terminology is handled accurately, the mathematical content is preserved correctly, and the Chinese reads naturally with appropriate academic register. Minor improvements could be made to a few word choices for better naturalness in Chinese technical writing, but these are non-critical. No syntax errors were found in the changed sections. The translation of the 'Adding Conditions' section accurately conveys the technical concepts, including the distinction between assignment (=) and equality testing (==), with clear and natural Chinese phrasing The 'Random Draws' section is translated accurately with proper technical terminology, including correct rendering of 'bound' as '绑定' and 'callable' as '可调用对象' Exercise descriptions in the modified Exercises section are translated clearly and maintain the logical structure of the original, with proper mathematical notation preserved The note about string argument 'U' and equality testing syntax in 'Adding Conditions' is translated with good pedagogical clarity Comment translations in code blocks (e.g., '# 空列表', '# max() 是 Python 内置函数') are accurate and consistent Suggestions:
🔍 Diff Quality
Summary: The translation sync is correct: all source changes are accurately reflected in the target document at the correct positions, document structure is preserved, and the heading map requires no updates since no headings were added or renamed. This review was generated automatically by action-translation review mode. |
There was a problem hiding this comment.
Pull request overview
Updates the zh-cn translation of the Functions lecture to align with upstream changes replacing legacy np.random convenience functions with the NumPy Generator API, and refreshes the translation sync state metadata accordingly.
Changes:
- Replace
np.random.randn()/np.random.uniform()usage withrng = np.random.default_rng()plusrng.standard_normal()/rng.uniform(). - Adjust surrounding explanatory text to refer to callables and
Generatormethods. - Update
.translate/state/functions.md.ymlto reflect the new upstream source SHA, sync date, mode, and tool version.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
lectures/functions.md |
Migrates random-number examples/exercises to default_rng() + Generator methods and updates related narrative text. |
.translate/state/functions.md.yml |
Updates translation-sync metadata (source SHA, synced-at, mode, tool version). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Automated Translation Sync
This PR contains automated translations from QuantEcon/lecture-python-programming.
Source PR
#541 - [functions.md] Update np.random → Generator API
Files Updated
lectures/functions.md.translate/state/functions.md.ymlDetails
This PR was created automatically by the translation action.