Skip to content

🌐 [translation-sync] [likelihood_var.md] Update np.random → Generator API - #225

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-22-32-pr-995
Open

🌐 [translation-sync] [likelihood_var.md] Update np.random → Generator API#225
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-22-32-pr-995

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

#995 - [likelihood_var.md] Update np.random → Generator API

Files Updated

  • ✏️ lectures/likelihood_var.md
  • ✏️ .translate/state/likelihood_var.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:22
@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 90a62da
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6d2e3c588b0c0007e58622
😎 Deploy Preview https://deploy-preview-225--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 — 2 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other); accuracy 8 below floor 9; terminology 8 below floor 9; formatting 7 below floor 8


📝 Translation Quality

Criterion Score
Accuracy 8/10
Fluency 8/10
Terminology 8/10
Formatting 7/10
Overall 7.9/10

Summary: The translation of the changed sections is accurate and fluent overall, correctly preserving mathematical content, code structure, and technical terminology. Minor issues include a slight loss of nuance in the 'connect to' phrasing in the Application section, an inconsistency in how the recurring 'nature = f/g' plot title phrase is handled (left untranslated in earlier examples but translated in the Samuelson section), and unexplained added font-configuration code not present in the source. No syntax errors were found in code blocks, math blocks, or MyST directives. Mathematical notation and LaTeX equations are preserved accurately across all changed sections Code comments are consistently and naturally translated into Chinese while preserving code functionality Technical terminology such as '似然比过程', '对数似然', '边际消费倾向', '加速系数' is used correctly and consistently with the glossary

Suggestions:

  • [minor · accuracy] lectures/likelihood_var.md — ## Application: Samuelson multiplier-accelerator: The English source says 'Now let's connect to the Samuelson multiplier-accelerator model.' but the translation says '现在让我们来看萨缪尔森乘数-加速器模型' (Now let's look at...), losing the sense of 'connect' which is important since this section links back to the VAR likelihood framework. → 现在让我们将其与萨缪尔森乘数-加速器模型联系起来。
  • [minor · terminology] lectures/likelihood_var.md — Neyman-Pearson decision rule paragraph: There should be a space between the Chinese text and the inline MyST directive {doc}likelihood_ratio_process, per the language-specific policy. Currently it reads '让我们应用 {doc}likelihood_ratio_process 中描述的Neyman-Pearson频率主义决策规则' which already has spaces around the directive, but 'Neyman-Pearson频率主义决策规则' lacks a space between the Latin term 'Neyman-Pearson' and the Chinese characters, which is … → 让我们应用 {doc}likelihood_ratio_process 中描述的 Neyman-Pearson 频率主义决策规则
  • [minor · fluency] lectures/likelihood_var.md — ## Overview - library import comment: The translation added extra font-configuration code (FONTPATH, mpl.font_manager, plt.rcParams) not present in the English source's code cell. While this may be an intentional localization for CJK font rendering in the notebook, it constitutes added content beyond translation scope and should be flagged for consistency review. → Confirm this font-loading addition is part of the standard translation pipeline convention for all lectures; if so, no action needed, otherwise remove to match source exactly.
  • [nit · terminology] lectures/likelihood_var.md — figure titles: '真实模型 = f' vs earlier 'nature = f': Earlier in the document (Examples 1 and 2), 'nature = f' in plot titles was left untranslated as 'nature = f'/'nature = g', but in the Samuelson application section the equivalent phrase was translated to '真实模型 = f'/'真实模型 = g'. This is an inconsistency in how the same recurring phrase is handled across sections. → Use a consistent treatment throughout, e.g., either keep 'nature = f' untranslated everywhere or translate consistently as '真实模型 = f' everywhere.

🔍 Diff Quality

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

Summary: The rng-related changes (import, rng = np.random.default_rng(), and function signature updates for simulate_var/simulate_samuelson and their call sites) were correctly and positionally mirrored in the target document, with structure and heading metadata unaffected and correctly preserved.

Issues:

  • Minor stylistic diff: target changed comma style from ',' to ',' inconsistently in the final paragraphs (e.g. '在左图中,数据由...' became '在左图中,数据由...'), which is unrelated to the rng sync but is a harmless side-edit within the same modified file/section.

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 Chinese lecture likelihood_var.md to use NumPy’s Generator API (via np.random.default_rng()) instead of legacy np.random.* calls, aligning the translated content with the upstream source PR.

Changes:

  • Introduced a module-level rng = np.random.default_rng() and replaced np.random.randn with rng.standard_normal.
  • Updated simulate_var / simulate_samuelson to accept an RNG and wired all call sites accordingly (including SciPy mvn.rvs(..., random_state=rng)).
  • Updated translation sync state metadata (source-sha, synced-at, mode, tool-version).

Reviewed changes

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

File Description
lectures/likelihood_var.md Switches simulation randomness to the Generator API and threads rng through simulation helpers and call sites.
.translate/state/likelihood_var.md.yml Updates translation-sync bookkeeping to reflect the new upstream source SHA 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