Skip to content

🌐 [translation-sync] [svd_intro.md] Update np.random → Generator API - #218

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-20-30-pr-1003
Open

🌐 [translation-sync] [svd_intro.md] Update np.random → Generator API#218
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-07-31T23-20-30-pr-1003

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

#1003 - [svd_intro.md] Update np.random → Generator API

Files Updated

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

Details

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

This PR was created automatically by the translation action.

Copilot AI review requested due to automatic review settings July 31, 2026 23:20
@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 4b9506a
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6d2dc39660310008425271
😎 Deploy Preview https://deploy-preview-218--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 — 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 two modified sections (Four Fundamental Subspaces and Full and Reduced SVD's) is accurate, technically sound, and preserves the mathematical formatting well. Terminology is consistent with the glossary. Minor issues include a slightly awkward sentence split when introducing vectors u_i and v_i, and inconsistent spacing between Chinese text and inline math in a few bullet points. No critical syntax errors were found in the changed sections. Mathematical notation and equation labels (eq:SVD101, eq:fullSVDpartition, etc.) are preserved accurately across the changed sections Technical vocabulary such as 完全SVD/简化SVD, 列空间, 零空间, 左零空间, 正交补 is translated consistently and matches standard linear algebra terminology The logical flow and structure of the Four Fundamental Subspaces and Full/Reduced SVD sections closely mirrors the source, preserving all equations and code blocks intact

Suggestions:

  • [minor · formatting] lectures/svd_intro.md — ## 四个基本子空间, sentence starting '令$u_i, i = 1, \ldots, m$为$U$的$m$个列向量,令': A sentence is awkwardly split across two lines/paragraphs ('令$u_i...$为$U$的$m$个列向量,令' followed on the next line by '设 $v_i, i = 1, \ldots, n$$V$$n$ 个列向量。'), creating a broken sentence flow and inconsistent spacing style (no spaces around inline math in the first clause vs spaces in the second). → 合并为一句并统一格式:'令 $u_i, i = 1, \ldots, m$$U$$m$ 个列向量,令 $v_i, i = 1, \ldots, n$$V$$n$ 个列向量。'
  • [minor · formatting] lectures/svd_intro.md — ## 四个基本子空间, list bullets defining column/null/row/left-null space: Missing spaces between Chinese text and inline math expressions in several bullet points (e.g., '列空间$X$,记作${\mathcal C}(X)$' should have a space after 列空间 and before $X$), inconsistent with the spacing convention used elsewhere in the translation. → 例如改为:'列空间 $X$,记作 ${\mathcal C}(X)$,是 $X$ 的列向量的张成空间...' 等,在中文与行内数学公式之间加空格。
  • [minor · formatting] lectures/svd_intro.md — code-cell under Four Fundamental Subspaces example: The translated code cell adds font-configuration lines (import matplotlib as mpl, FONTPATH, addfont, rcParams) that are not present in the English source's corresponding code cell. While this may be a standard practice for rendering Chinese characters in plots, it is an unannounced addition not found in the source, which could be flagged as added content beyond translation scope. → If this is a project-wide convention for CJK font rendering, note it explicitly as intentional; otherwise keep the code cell identical to the English source and add font handling elsewhere.

🔍 Diff Quality

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

Summary: The translation sync correctly applied the rng.default_rng() refactor in the same two code cells with no structural or metadata regressions.


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 svd_intro lecture to match the upstream change from NumPy’s legacy global RNG (np.random.rand) to the recommended Generator API (np.random.default_rng()), keeping the lecture’s random-matrix examples consistent with current NumPy best practices.

Changes:

  • Introduces a rng = np.random.default_rng() instance in the lecture to serve as the shared random number generator.
  • Replaces np.random.rand(...) calls with rng.random((...)) in SVD example code cells.
  • Updates translation-sync state metadata (source SHA, sync date, mode, tool version).

Reviewed changes

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

File Description
lectures/svd_intro.md Switches random-number usage in code cells to the Generator API via a shared rng.
.translate/state/svd_intro.md.yml Updates translation sync state to reflect the new upstream source commit and tooling metadata.

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

@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 31, 2026 23:55 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