Skip to content

๐ŸŒ [translation-sync] [need_for_speed.md] Update np.random โ†’ Generator API#62

Open
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-05T13-04-56-pr-545
Open

๐ŸŒ [translation-sync] [need_for_speed.md] Update np.random โ†’ Generator API#62
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-05T13-04-56-pr-545

Conversation

@mmcky
Copy link
Copy Markdown
Contributor

@mmcky mmcky commented May 5, 2026

Automated Translation Sync

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

Source PR

#545 - [need_for_speed.md] Update np.random โ†’ Generator API

Files Updated

  • โœ๏ธ lectures/need_for_speed.md
  • โœ๏ธ .translate/state/need_for_speed.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 5, 2026

โœ… Translation Quality Review

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


๐Ÿ“ Translation Quality

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

Summary: The translation of the 'Vectorization vs pure Python loops' section is accurate, fluent, and well-formatted. The technical content is faithfully rendered, code comments are appropriately translated, and the list structure is preserved. No significant issues were found in this changed section. The three-step breakdown of vectorized operations (็”Ÿๆˆใ€ๆฑ‚ๅนณๆ–นใ€ๆฑ‚ๅ’Œ) accurately mirrors the English source Code comment translation '# ๅฐ†็ดฏๅŠ ๅนถๅญ˜ๅ‚จๆ€ปๅ’Œ' naturally conveys the meaning of '# Will accumulate and store sum' Technical term 'ๆ‰น้‡็ฎ—ๅญ' for 'batch operators' is appropriate in context The phrase 'ๅ‡ๅŒ€ๅˆ†ๅธƒ็š„้šๆœบๆ•ฐ' accurately conveys 'uniforms' in the statistical sense


๐Ÿ” Diff Quality

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

Summary: The translation target document correctly mirrors the single source change: replacing np.random.uniform(0, 1, n) with rng = np.random.default_rng() / rng.uniform(0, 1, n) in the vectorized code cell, at the same relative position within the 'Vectorization vs pure Python loops' section, with no structural or metadata changes required.


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 zh-cn lecture content to match upstream changes that migrate from the legacy np.random global API to the newer NumPy Generator API, and refreshes the corresponding translation state metadata.

Changes:

  • Updated the NumPy random sampling example to use rng = np.random.default_rng() and rng.uniform(...) instead of np.random.uniform(...).
  • Updated .translate/state/need_for_speed.md.yml with the new upstream source-sha and synced-at date.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lectures/need_for_speed.md Switches the vectorization example from np.random.uniform to the Generator API (default_rng().uniform).
.translate/state/need_for_speed.md.yml Updates translation-sync metadata (source-sha, synced-at) to reflect the new upstream source 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