🌐 [translation-sync] [need_for_speed.md] Update np.random → Generator API#119
🌐 [translation-sync] [need_for_speed.md] Update np.random → Generator API#119
Conversation
✅ Deploy Preview for majestic-griffin-10b166 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-4-6 | Date: 2026-05-05 📝 Translation Quality
Summary: The translation of the 'Vectorization vs pure Python loops' section is generally accurate and well-formatted. Terminology follows the reference glossary correctly. Minor fluency issues exist around the phrasing of 'non-vectorized code' and the step description 'draw n uniforms', which could be expressed more naturally in Persian. The inline English code comment is left untranslated, which may be intentional but is worth flagging for consistency. Technical terminology is consistently and correctly applied throughout the changed section, matching the reference glossary (e.g., 'برداریسازی' for Vectorization, 'حلقه' for loop). The MyST/Markdown formatting, including code cells, directives, and list structures, is fully preserved in the changed section. The overall structure and meaning of the 'Vectorization vs pure Python loops' section is accurately conveyed, including the three-step breakdown of the vectorized operation. Suggestions:
🔍 Diff Quality
Summary: The translation correctly mirrors the source change, replacing the old vectorized code block with the new RNG-based implementation in the same position, with no structural or metadata issues. This review was generated automatically by action-translation review mode. |
There was a problem hiding this comment.
Pull request overview
Syncs the Persian translation of need_for_speed.md with upstream changes that migrate an example from the legacy np.random API to the newer numpy.random.Generator API, keeping the translated lecture aligned with the source repository.
Changes:
- Updated the NumPy vectorization example to create a
rng = np.random.default_rng()and userng.uniform(...)instead ofnp.random.uniform(...). - Updated translation sync state metadata (
source-sha,synced-at) forneed_for_speed.md.
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 | Updates the random sampling example to use NumPy’s Generator API (default_rng + rng.uniform). |
| .translate/state/need_for_speed.md.yml | Updates translation sync tracking metadata to reflect the new upstream source revision and sync date. |
💡 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
#545 - [need_for_speed.md] Update np.random → Generator API
Files Updated
lectures/need_for_speed.md.translate/state/need_for_speed.md.ymlDetails
This PR was created automatically by the translation action.