Skip to content

🌐 [translation-sync] [os_stochastic.md] Update np.random → Generator API - #224

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

🌐 [translation-sync] [os_stochastic.md] Update np.random → Generator API#224
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-21-46-pr-997

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

#997 - [os_stochastic.md] Update np.random → Generator API

Files Updated

  • ✏️ lectures/os_stochastic.md
  • ✏️ .translate/state/os_stochastic.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 1f6e6ed
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6d2e0fbd9490000887eaf6
😎 Deploy Preview https://deploy-preview-224--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: editor — 1 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other)


📝 Translation Quality

Criterion Score
Accuracy 9/10
Fluency 9/10
Terminology 9/10
Formatting 9/10
Overall 9/10

Summary: The modified sections (The Bellman Operator and Model) are translated accurately, fluently, and consistently with the provided glossary. Technical terms, code comments, and math are well preserved with correct MyST formatting and full-width punctuation. Only very minor stylistic nits were found; no accuracy or syntax errors are present in the changed sections. Accurate and consistent rendering of key dynamic programming terms such as '贝尔曼算子' and '逐期最优' across the modified sections Mathematical notation and code blocks are preserved intact with no corruption Natural academic register maintained in Chinese, matching the tone of the English source

Suggestions:

  • [minor · terminology] lectures/os_stochastic.md — ### 模型 (Model, Computation section) - class Model docstring comments: Comment translations for NamedTuple fields (e.g., '效用函数', '生产函数', '贴现因子', '冲击位置参数', '冲击尺度参数', '状态网格', '冲击抽样') are accurate and consistent with the glossary; no issue found, but 'shocks: np.ndarray # 冲击抽样' could be more precisely '冲击抽取值/样本' to match 'shock draws' more literally. This is a nit-level improvement only. → shocks: np.ndarray # 冲击抽取值
  • [nit · fluency] lectures/os_stochastic.md — ### The Bellman Operator (Computation section): The line '下面的函数实现了贝尔曼算子。' followed by '下面是这个函数:' for get_greedy is slightly redundant/ambiguous since get_greedy is a separate greedy policy function, not part of the Bellman operator per se, but this mirrors the English source structure so it's acceptable.

🔍 Diff Quality

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

Summary: The RNG modernization code change was correctly synced into the target document at the matching location within the create_model function under the Model/Computation section, with translation metadata correctly left unchanged since no headings were altered.


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 translation-sync PR updates the Chinese os_stochastic.md lecture to align with upstream changes that migrate NumPy’s legacy np.random usage to the newer Generator API, while also cleaning up extraneous whitespace in the markdown.

Changes:

  • Replace np.random.seed / np.random.randn with np.random.default_rng(seed) + rng.standard_normal(...) in the model setup code cell.
  • Remove whitespace-only blank lines between sections to normalize markdown formatting.
  • Update translation state metadata to the new upstream source-sha, sync date, mode, and tool version.

Reviewed changes

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

File Description
lectures/os_stochastic.md Updates the lecture’s random number generation example to the NumPy Generator API and tidies whitespace-only blank lines.
.translate/state/os_stochastic.md.yml Updates translation-sync state metadata (source SHA, synced date, mode, tool version).

💡 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