🌐 [translation-sync] [numba.md] Update np.random → Generator API#70
🌐 [translation-sync] [numba.md] Update np.random → Generator API#70mmcky wants to merge 2 commits into
Conversation
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-15 📝 Translation Quality
Summary: The translation of the Exercises section and preamble is accurate, fluent, and terminologically consistent with the glossary. Technical concepts like data races, parallel loops, and Monte Carlo estimation are rendered clearly in natural academic Chinese. No syntax errors were found in the changed sections. The added translation metadata and i18n font-loading code are expected additions per the project's translation pipeline conventions and not translation errors. Technical terminology (JIT编译, 并行化, 数据竞争, 有效样本量) is translated accurately and consistently with domain conventions Complex explanatory passages about data races and reproducibility (症状1/症状2 sections) are rendered clearly and naturally in Chinese while preserving technical precision Code comments are appropriately translated where relevant (e.g., '# 除以半径的平方', '# 分别为离开低状态和高状态的概率') while code syntax remains untouched All MyST directives, exercise/solution blocks, and math expressions are correctly preserved without structural errors Suggestions:
🔍 Diff Quality
Summary: The translation sync correctly added new exercises, solutions, and explanatory content in matching positions and order, preserved document structure, and the heading map update is accurate (including a minor supplemental fix for previously missing heading entries). Issues:
This review was generated automatically by action-translation review mode. |
There was a problem hiding this comment.
Pull request overview
This automated translation sync updates the Chinese numba lecture to reflect upstream changes that migrate examples from np.random.* to the newer NumPy Generator API, including discussion of performance and parallel safety considerations in Numba.
Changes:
- Updated Monte Carlo π examples to use pre-drawn samples and
np.random.default_rng()(and added a new exercise/solution explaining RNG data races underprange). - Updated the Markov-chain simulation example to use a
Generator-produced draw array passed into the function (instead of drawing inside). - Refreshed 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 code cells to use Generator APIs and adds parallel RNG caveats/exercises. |
.translate/state/numba.md.yml |
Updates translation sync metadata to match the upstream source commit and tooling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| n = 1_000_000 | ||
| rng = np.random.default_rng() | ||
| u_draws = rng.uniform(size=n) | ||
| v_draws = rng.uniform(size=n) |
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.