Skip to content

🌐 [translation-sync] [likelihood_ratio_process.md] Update np.random β†’ Generator API - #228

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-25-54-pr-976
Open

🌐 [translation-sync] [likelihood_ratio_process.md] Update np.random β†’ Generator API#228
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-25-54-pr-976

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

#976 - [likelihood_ratio_process.md] Update np.random β†’ Generator API

Files Updated

  • ✏️ lectures/likelihood_ratio_process.md
  • ✏️ .translate/state/likelihood_ratio_process.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:25
@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 37a4536
πŸ” Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6d2f07674f040008357b15
😎 Deploy Preview https://deploy-preview-228--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 8/10
Overall 8.9/10

Summary: The translation of the changed sections is accurate, fluent, and terminologically consistent, with proper preservation of mathematical formatting and code blocks. Only minor issues were found: one inconsistent translation of 'nature' as '本质' instead of 'θ‡ͺη„Ά' in a plot title, and an unexplained addition of font-configuration code not present in the English source, which should be verified as intentional shared infrastructure rather than a translation artifact. Mathematical notation and LaTeX equations are preserved accurately throughout all modified sections Technical terminology (e.g., δΌΌη„Άζ―”, 库尔贝克-θŽ±εΈƒε‹’ζ•£εΊ¦, 第一类/η¬¬δΊŒη±»ι”™θ――, ζ£€ζ΅‹ζ¦‚ηŽ‡, θ™šθ­¦ζ¦‚ηŽ‡) is applied consistently and matches standard usage Complex statistical/probabilistic explanations (e.g., KL divergence link to likelihood ratios, Chernoff entropy, ROC curves) are translated clearly and read naturally in academic Chinese

Suggestions:

  • [minor Β· formatting] lectures/likelihood_ratio_process.md β€” Overview - Python import cell: The translation adds extra code (font configuration lines: FONTPATH, mpl.font_manager.fontManager.addfont, plt.rcParams) that does not exist in the English source code cell. This changes the technical content of a code block beyond translation, which is outside the scope of pure translation and could cause a mismatch with the source if the font file is not actually present in the build environmen… β†’ Remove the added font-configuration lines or confirm they are part of an approved shared build config for all translated lectures; if so, this is not a translation quality issue but should be verified separately.
  • [minor Β· terminology] lectures/likelihood_ratio_process.md β€” ### Simulations - plot title '马尔可倫链似焢比(本质 = f)': The plot title translates 'nature = f' as '本质 = f', but elsewhere in the document 'θ‡ͺη„Ά' is consistently used to translate 'nature' (as the entity making draws). '本质' means 'essence/nature (character)', which is a mistranslation in this context and inconsistent with the rest of the document. β†’ ζ”ΉδΈΊ 'ι©¬ε°”ε―ε€«ι“ΎδΌΌη„Άζ―”οΌˆθ‡ͺη„Ά = fοΌ‰'
  • [minor Β· formatting] lectures/likelihood_ratio_process.md β€” ### A third distribution $h$ (llr_h anchor, listed in Overview heading map as 'Likelihood ratio test::A third distribution $h$'): In the PR's stated list of modified sections, '### A helpful formula' is listed as changed, but the heading mapping in front matter groups it as a subsection under 'Likelihood ratio test' rather than reflecting that this subsection may have been reorganized; this is a minor structural note rather than a translation defect, but worth flagging since the surrounding heading id path could affect cros… β†’ Verify the heading path mapping for '### A helpful formula' and '### A third distribution $h$' matches the actual document structure used by the sync tool.

πŸ” Diff Quality

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

Summary: The translation sync correctly applied all RNG refactoring changes (adding rng = np.random.default_rng() and threading rng through function signatures) to the Chinese document while preserving translated prose, frontmatter, and structure.


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_ratio_process.md to align with upstream changes that migrate randomness from legacy np.random.* calls to the NumPy Generator API (via a shared rng = np.random.default_rng()), plus updates the translation sync state metadata.

Changes:

  • Introduces a shared rng and threads it through multiple simulation functions (Beta draws, uniform draws, choices) to replace legacy global RNG usage.
  • Updates call sites throughout the lecture to pass rng into the updated function signatures.
  • Updates .translate/state/likelihood_ratio_process.md.yml to reflect the new source commit SHA, sync date, mode, and tool version.

Reviewed changes

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

File Description
lectures/likelihood_ratio_process.md Replaces np.random.* with rng.* and updates function signatures/call sites accordingly.
.translate/state/likelihood_ratio_process.md.yml Updates translation-sync state metadata (source SHA, date, mode, tool version).

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 167 to 171
@jit
def simulate_likelihood_ratios(a, b, f_func, g_func, T=50, N=500):
def simulate_likelihood_ratios(a, b, f_func, g_func, rng, T=50, N=500):
"""
Generate N sets of T observations of the likelihood ratio.
"""
@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:07 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