Skip to content

🌐 [translation-sync] [exchangeable] Simplify code and bring lecture into style-guide compliance - #233

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-08-03T02-02-51-pr-772
Open

🌐 [translation-sync] [exchangeable] Simplify code and bring lecture into style-guide compliance#233
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-08-03T02-02-51-pr-772

Conversation

@mmcky

@mmcky mmcky commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

This PR contains automated translations from QuantEcon/lecture-python.myst.

Source PR

#772 - [exchangeable] Simplify code and bring lecture into style-guide compliance

Files Updated

  • ✏️ lectures/exchangeable.md
  • ✏️ .translate/state/exchangeable.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 August 3, 2026 02:02
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Aug 3, 2026
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit 195946e
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a6ff6d0e202f00008131499
😎 Deploy Preview https://deploy-preview-233--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

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-03
Routing: editor — 1 major finding(s); 3 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other); accuracy 8 below floor 9; terminology 8 below floor 9; formatting 6 below floor 8


📝 Translation Quality

Criterion Score
Accuracy 8/10
Fluency 8/10
Terminology 8/10
Formatting 6/10
Overall 7.7/10

Summary: The translation of the changed sections is accurate, fluent, and terminologically consistent with the glossary. The main concern is the unexplained addition of matplotlib font-configuration code in the imports cell, which alters the executable code compared to the source and should be flagged/verified. Minor spacing inconsistencies between Chinese text and Latin letters (F/G) appear in a few code comments and legend labels. Mathematical notation, equations, and LaTeX labels are preserved accurately throughout all changed sections New subsections (The likelihood ratio, densities, belief dynamics, another instance) are translated fluently and consistently with correct technical vocabulary Glossary terms such as 独立同分布, 可交换性, 贝叶斯定律, 似然比, 先验/后验概率 are used consistently and correctly

Suggestions:

  • [major · formatting] lectures/exchangeable.md — code-cell import block under ## Overview: The translated import code cell adds matplotlib font-configuration lines (FONTPATH, mpl.font_manager, plt.rcParams for font family and figure size) that do not exist in the English source's code cell. This is a substantive, unexplained change to executable code content, not just prose translation, and changes the actual notebook behavior/output compared to the source. → Remove the added font-configuration lines so the code cell matches the English source's imports exactly, unless this is a documented site-wide convention applied consistently across all translated lectures.
  • [minor · terminology] lectures/exchangeable.md — ### Sample paths of $\pi_t$ / plot code comments: Code comments '# when nature selects F' and '# when nature selects G' were translated to '# 当自然选择F时' and '# 当自然选择G时', missing a space between Chinese characters and the Latin letter F/G, which is inconsistent with the spacing convention used elsewhere (e.g. 'F生成' also lacks spacing). While this is inside code comments rather than prose, for consistency consider adding spaces: '当自然选择 F 时'. → 当自然选择 F 时 / 当自然选择 G 时
  • [minor · terminology] lectures/exchangeable.md — ### Rates of convergence, legend labels: Legend labels 'F generates' and 'G generates' were translated as 'F生成' and 'G生成' without a space between the Latin letter and Chinese characters, inconsistent with the glossary's spacing rule for mixed Chinese/Latin text. → F 生成 / G 生成
  • [minor · accuracy] lectures/exchangeable.md — ### Dynamics of the belief, description of decision maker's uncertainty: "describes his ignorance with a subjective probability" was translated as "用...来描述他的不确定性" (describes his uncertainty), which slightly shifts the nuance from 'ignorance' (不知情/无知) to 'uncertainty' (不确定性); minor but consistent shift also appears in the bullet list further down ('doesn't know' expressed via '不知道'... 'expresses his ignorance' → '表达他的不确定性'). This is a minor semantic drift, not a major … → 考虑将“不确定性”改为更贴近“无知/不知情”的表述,如“描述他的无知状态”

🔍 Diff Quality

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

Summary: The translation sync correctly mirrors all structural, frontmatter, code-refactoring, and heading-map changes from the English source in the same relative positions.


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 MyST lecture exchangeable.md to match upstream style-guide compliant changes from QuantEcon/lecture-python.myst, including refactoring the lecture’s plotting/simulation code and refreshing Jupytext/translation metadata.

Changes:

  • Updated Jupytext/front-matter metadata (kernel display name, jupytext versions) and refined translation heading mappings.
  • Refactored the “Bayesian updating” visualization code into smaller reusable functions and rewrote the simulation section to use vectorized odds/cumulative products.
  • Updated translation sync state (source-sha, synced-at, mode, tool-version).

Reviewed changes

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

File Description
lectures/exchangeable.md Syncs lecture content/code with upstream refactor + style-guide compliance updates.
.translate/state/exchangeable.md.yml Updates translation-sync tracking metadata for the new upstream source commit.

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

Comment thread lectures/exchangeable.md
Comment on lines +455 to +473
ax.plot(f(w_grid), w_grid, label='$f$', lw=2)
ax.plot(g(w_grid), w_grid, label='$g$', lw=2)
ax.vlines(1, 0, 1, linestyle='--')
ax.hlines(roots, 0, 2, linestyle='--')
ax.legend(loc=4)
ax.set(xlabel='$f(w), g(w)$', ylabel='$w$')

# 无论哪个密度函数被着色,落入各区域的概率
area_lower = quad(f, 0, roots[0])[0]
area_middle = quad(g, roots[0], roots[1])[0]
area_upper = quad(f, roots[1], 1)[0]

ax.fill_between([0, 1], 0, roots[0], color='blue', alpha=0.15)
ax.text((f(0) + f(roots[0])) / 4, roots[0] / 2, f"{area_lower: .3g}")
w_middle = np.linspace(roots[0], roots[1], 20)
ax.fill_betweenx(w_middle, 0, g(w_middle), color='orange', alpha=0.15)
ax.text(np.mean(g(roots)) / 2, np.mean(roots), f"{area_middle: .3g}")
ax.fill_between([0, 1], roots[1], 1, color='blue', alpha=0.15)
ax.text((f(roots[1]) + f(1)) / 4, (roots[1] + 1) / 2, f"{area_upper: .3g}")
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

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