Skip to content

🌐 [translation-sync] [hansen_singleton_1983.md] Update np.random → Generator API - #226

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-24-01-pr-974
Open

🌐 [translation-sync] [hansen_singleton_1983.md] Update np.random → Generator API#226
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-24-01-pr-974

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

#974 - [hansen_singleton_1983.md] Update np.random → Generator API

Files Updated

  • ✏️ lectures/hansen_singleton_1983.md
  • ✏️ .translate/state/hansen_singleton_1983.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:24
@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 7ebb015
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6d2e9516bee7000897ab49
😎 Deploy Preview https://deploy-preview-226--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 'Likelihood implementation' section is translated accurately and fluently, with correct handling of technical terminology (likelihood, residuals, covariance matrix, Jacobian, OPG standard errors, etc.) and full preservation of code blocks, math, and MyST formatting. No syntax errors or accuracy issues were found; only very minor stylistic nits could be considered for further polish. The dense mathematical/statistical prose in the 'Likelihood implementation' section is translated with precise and consistent terminology (对数似然、残差、协方差矩阵、雅可比 etc.), matching the glossary and prior sections. All code comments and docstrings within the changed section are fully and accurately translated while preserving code structure and functionality. Math notation, equation labels, and MyST cross-references (e.g., {eq}hs83-loglik) are preserved exactly as in the source, with correct spacing around inline directives per the language policy.

Suggestions:

  • [minor · terminology] lectures/hansen_singleton_1983.md — ## 似然的实现 / '组成部分有:' list: The English phrase 'the Gaussian log-likelihood itself' is translated as '高斯对数似然本身', which is fine, but the parallel structure of the bullet list ('a function to..., a function to..., a function to..., and the Gaussian log-likelihood itself') is slightly weakened because the fourth item doesn't start with '一个函数' like an implied parallel item, though this is a minor stylistic issue not an error. → No change strictly required; optional: '以及高斯对数似然函数本身' for closer parallelism.
  • [nit · fluency] lectures/hansen_singleton_1983.md — ## 似然的实现, comment '# 来自无限制 VAR 的 OLS 种子': Code comment translation reads naturally but could be tightened; 'OLS 种子' is a literal but acceptable rendering of 'OLS seed', consistent with usage elsewhere in the document.

🔍 Diff Quality

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

Summary: The translation sync correctly mirrors the source's np.random.default_rng refactor and blank-line removal, with no scope or structural issues, aside from one minor unrelated wording tweak.

Issues:

  • A sentence near 'residual_diagnostics' function definition was reworded in the target ('残差诊断下面总结了...' vs '下面的残差诊断总结了...') in a way that doesn't clearly correspond to a source change and reads less naturally in Chinese, though it doesn't affect structure or scope.

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 PR syncs the zh-cn translation of hansen_singleton_1983.md with upstream changes that migrate NumPy RNG usage from the legacy global np.random API to the Generator (default_rng) API, and updates the translation sync state metadata accordingly.

Changes:

  • Updated the lecture’s simulation code to use rng = np.random.default_rng(seed) and rng.multivariate_normal(...) instead of the global np.random state.
  • Minor markdown text/whitespace adjustments in the lecture content.
  • Updated .translate/state/hansen_singleton_1983.md.yml to reflect the new source SHA, model, sync date, and tool version.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lectures/hansen_singleton_1983.md Switches simulation randomness to Generator API; includes a small translated-text wording change.
.translate/state/hansen_singleton_1983.md.yml Updates translation sync metadata (source SHA/date/model/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:06 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