Skip to content

🌐 [translation-sync] [functions.md] Update np.random → Generator API#61

Open
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-04T05-31-16-pr-541
Open

🌐 [translation-sync] [functions.md] Update np.random → Generator API#61
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-04T05-31-16-pr-541

Conversation

@mmcky
Copy link
Copy Markdown
Contributor

@mmcky mmcky commented May 4, 2026

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.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 4, 2026

✅ Translation Quality Review

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


📝 Translation Quality

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

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:

  • Adding Conditions - '希望 if/else 子句的语法是不言自明的' → consider '希望 if/else 子句的语法能够自我解释' or '希望 if/else 子句的语法一目了然'; '不言自明' is valid but '一目了然' reads more naturally in this technical context

  • Exercises (func_ex3) - '掷一枚无偏硬币' → '投掷一枚公平硬币'; 'unbiased coin' in probability/statistics contexts is more commonly rendered as '公平硬币' rather than '无偏硬币' in Chinese technical writing

  • Exercises (func_ex3) - '随机装置' for 'random device' → consider '随机机制' or '随机试验装置'; while '随机装置' is acceptable, '随机机制' may read more naturally in Chinese mathematical contexts


🔍 Diff Quality

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

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.

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

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 with rng = np.random.default_rng() plus rng.standard_normal() / rng.uniform().
  • Adjust surrounding explanatory text to refer to callables and Generator methods.
  • Update .translate/state/functions.md.yml to 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.

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