🌐 [translation-sync] [numpy.md] Update np.random → Generator API#122
🌐 [translation-sync] [numpy.md] Update np.random → Generator API#122mmcky wants to merge 2 commits into
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-13 📝 Translation Quality
Summary: The Persian translation of the modified sections is of high quality. All five changed sections (Mutability, Making Copies, Universal Functions, Sub-packages, Implicit Multithreading, and Exercises) are accurately translated with natural Farsi phrasing and consistent technical terminology. Formatting is well-preserved with no syntax errors. Minor fluency improvements are possible in a few places but do not significantly impact comprehension. The translation successfully balances technical precision with natural Persian academic prose. Consistent and accurate use of established Persian technical terminology throughout all modified sections (e.g., 'قابلیت تغییر' for Mutability, 'توابع جهانی' for Universal Functions, 'بستههای فرعی' for Sub-packages, 'چندنخی ضمنی' for Implicit Multithreading) Mathematical content, LaTeX equations, and code blocks are perfectly preserved across all modified sections with no formatting errors The Exercises section is translated with high accuracy, preserving the logical structure of multi-part problems and solution hints Deep copy terminology ('deep copy' kept with Persian explanation 'کپی مستقل') is handled appropriately in the Making Copies section, balancing technical precision with readability The translation maintains a consistent academic register appropriate for a technical programming tutorial throughout all modified sections Suggestions:
🔍 Diff Quality
Summary: The translation document correctly mirrors all source changes: the deprecated This review was generated automatically by action-translation review mode. |
There was a problem hiding this comment.
Pull request overview
This PR syncs the Persian translation of the NumPy lecture with upstream changes that migrate examples from the legacy np.random.* API to NumPy’s Generator-based random API, and updates the translation sync state metadata accordingly.
Changes:
- Replaced uses of
np.random.randn,np.random.binomial, andnp.random.seedwithnp.random.default_rng()+Generatormethods likestandard_normalandbinomial. - Updated the
DiscreteRVexercise solution to use an instance RNG (default_rng(seed)) andrng.uniform(...). - Updated translation sync state (
source-sha, sync date, model, tool version).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lectures/numpy.md | Updates random-number generation examples to the Generator API and adjusts related exercise solution code. |
| .translate/state/numpy.md.yml | Updates translation-sync bookkeeping (source SHA, sync timestamp, model/mode, tool version). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def __init__(self, q, seed=None): | ||
| """ | ||
| آرگومان q یک آرایه NumPy است، یا شبیه آرایه، غیر منفی و جمع | ||
| به 1 میشود | ||
| """ | ||
| self.q = q | ||
| self.Q = cumsum(q) | ||
| self.rng = np.random.default_rng(seed) |
Automated Translation Sync
This PR contains automated translations from QuantEcon/lecture-python-programming.
Source PR
#549 - [numpy.md] Update np.random → Generator API
Files Updated
lectures/numpy.md.translate/state/numpy.md.ymlDetails
This PR was created automatically by the translation action.