🌐 [translation-sync] [numba.md] Update np.random → Generator API#133
🌐 [translation-sync] [numba.md] Update np.random → Generator API#133mmcky 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-5 | Date: 2026-07-15 📝 Translation Quality
Summary: ترجمه بخش تغییر یافته 'Exercises' با کیفیت بالا، دقت مفهومی خوب، رعایت اصطلاحات فنی مطابق گلاسری، و حفظ کامل ساختار Markdown/MyST انجام شده است. هیچ خطای نحوی یافت نشد و مشکلات جدی در محتوا مشاهده نمیشود؛ نکات ارائهشده صرفاً پیشنهادهای جزئی سبک نگارشی هستند. ترجمه بخش Exercises دقیق، روان و با حفظ کامل ساختار MyST/Markdown از جمله دایرکتیوهای exercise/solution انجام شده است اصطلاحات فنی مانند 'data race'، 'thread-safe'، 'Generator' و 'prange' با توضیحات مناسب و ارجاع به گلاسری حفظ شدهاند معادلات ریاضی، بلوکهای کد و ارجاعات متقابل (cross-references) بهدرستی بدون تغییر باقی ماندهاند لحن آکادمیک و طبیعی فارسی در توضیحات تمرینها و راهحلها بهخوبی رعایت شده است Suggestions:
🔍 Diff Quality
Summary: The translation sync correctly added all new content (intro paragraph, code cells, two new exercises/solutions, note block) in matching positions within the single modified file, with no heading changes required or missed. This review was generated automatically by action-translation review mode. |
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-15 📝 Translation Quality
Summary: The translation of the Exercises section is highly accurate, fluent, and terminologically consistent with the established glossary. Technical concepts around Numba, parallelization, Monte Carlo simulation, and data races are rendered clearly in Persian while preserving all code, math, and MyST formatting. Minor stylistic inconsistencies exist in code comment translation choices and occasional informal phrasing, but these do not impact comprehension or technical accuracy. Technical terminology (Monte Carlo, JIT, parallelization, data race, generator) is translated accurately and consistently with appropriate transliteration where needed (e.g., 'رقابت داده' for data race) Mathematical notation and LaTeX equations are preserved correctly throughout the Exercises section Code blocks, MyST directives (exercise, solution-start/end, hint), and cross-references (e.g., {ref} Suggestions:
🔍 Diff Quality
Summary: The translation sync correctly added all new content (intro paragraph, modified exercises, two new exercises, and the note block) in the same positions as the source, with proper translation and no structural or scope issues. 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 (fa) translation of the Numba lecture with upstream changes that migrate examples away from legacy np.random.* usage toward the NumPy Generator API, including new material explaining correctness/performance tradeoffs under parallel execution.
Changes:
- Pre-generates Monte Carlo draws using
np.random.default_rng()and passes them into JIT-compiled functions instead of drawing vianp.random.uniform()inside loops. - Adds new exercises/solutions discussing RNG data races in
prangeand safe approaches under parallel Numba execution. - Updates translation sync state metadata (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/numba.md | Updates translated lecture content and exercises to use Generator-based RNG patterns and adds explanations about parallel RNG safety. |
| .translate/state/numba.md.yml | Updates translation sync metadata to match the upstream source commit and tooling/model versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @jit(parallel=True) | ||
| def calculate_pi(n=1_000_000): | ||
| def calculate_pi_parallel(u_draws, v_draws): | ||
| n = len(u_draws) |
Automated Translation Sync
This PR contains automated translations from QuantEcon/lecture-python-programming.
Source PR
#550 - [numba.md] Update np.random → Generator API
Files Updated
lectures/numba.md.translate/state/numba.md.ymlDetails
This PR was created automatically by the translation action.