Skip to content

🌐 [translation-sync] [os_egm.md] Update np.random → Generator API - #223

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-21-37-pr-996
Open

🌐 [translation-sync] [os_egm.md] Update np.random → Generator API#223
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-21-37-pr-996

Conversation

@mmcky

@mmcky mmcky commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

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

Source PR

#996 - [os_egm.md] Update np.random → Generator API

Files Updated

  • ✏️ lectures/os_egm.md
  • ✏️ .translate/state/os_egm.md.yml

Details

  • Source Language: en
  • Target Language: zh-cn
  • Model: claude-sonnet-5

This PR was created automatically by the translation action.

@mmcky
mmcky requested review from Copilot July 31, 2026 23:21
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Jul 31, 2026
@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit c787e60
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6d2e050e2a770008a3d41c
😎 Deploy Preview https://deploy-preview-223--astonishing-narwhal-a8fc64.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-31
Routing: auto-merge — no gating findings; floors met


📝 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 Implementation section (and surrounding modified content) is accurate, fluent, and terminologically consistent with the glossary. Code blocks and math are fully preserved, and no syntax errors were found. Only very minor stylistic nits were identified regarding phrasing of code comments. Technical terminology (Coleman-Reffett 算子, 内生网格, 边际效用, 科布-道格拉斯 etc.) is translated accurately and consistently with the glossary Code comments within the Implementation section are all properly translated while code itself remains untouched, preserving functionality Mathematical notation and equation labels are fully preserved with correct LaTeX/MyST syntax Sentence structure in the Implementation section reads fluently and maintains appropriate academic register

Suggestions:

  • [minor · fluency] lectures/os_egm.md — ### The Operator, code comment '简化名称': '简化名称' is a literal translation of 'Simplify names' but reads slightly awkwardly in Chinese as a comment; a more natural phrasing would improve readability, though this is a minor stylistic issue within the Implementation section. → 简化变量名
  • [nit · fluency] lectures/os_egm.md — ### Testing, '这是我们的求解程序:': Translation is accurate and natural; no substantive issue, included only as a nit that 程序 could also be rendered as 例程 for closer alignment with 'routine', though both are acceptable.

🔍 Diff Quality

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

Summary: The core code translation (random seed API update) was correctly applied, but two extraneous blank-line deletions were introduced that don't match the source diff.

Issues:

  • Two blank lines were unintentionally removed in the target document (before '### 内生网格' and before '## 实现') that do not correspond to any change in the source document, causing the +3/-5 diff instead of the expected +2/-2

This review was generated automatically by action-translation review mode.

Copilot AI left a comment

Copy link
Copy Markdown

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 os_egm lecture’s random number generation to use NumPy’s modern Generator API (moving away from the legacy global np.random state), keeping the Chinese translation aligned with the upstream source lecture.

Changes:

  • Replaced np.random.seed + np.random.randn with a local rng = np.random.default_rng(seed) + rng.standard_normal(...) in the lecture code cell.
  • Removed a couple of whitespace-only lines in the markdown.
  • Updated translation-sync state metadata (source-sha, synced-at, model, tool-version, mode).

Reviewed changes

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

File Description
lectures/os_egm.md Switches RNG usage in the lecture example to Generator and applies minor markdown whitespace cleanup.
.translate/state/os_egm.md.yml Updates translation-sync tracking metadata to reflect the new upstream source and sync run.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 1, 2026 00:05 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants