Skip to content

🌐 [translation-sync] [kalman_2] Use a typed NamedTuple for WorkerModel - #238

Open
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-08-05T07-26-33-pr-644
Open

🌐 [translation-sync] [kalman_2] Use a typed NamedTuple for WorkerModel#238
mmcky wants to merge 2 commits into
mainfrom
translation-sync-2026-08-05T07-26-33-pr-644

Conversation

@mmcky

@mmcky mmcky commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

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

Source PR

#644 - [kalman_2] Use a typed NamedTuple for WorkerModel

Files Updated

  • ✏️ lectures/kalman_2.md
  • ✏️ .translate/state/kalman_2.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 lite review requested due to automatic review settings August 5, 2026 07:26
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation review lecture labels Aug 5, 2026
@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit fb83785
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a72e5aea67c9700084d41b3
😎 Deploy Preview https://deploy-preview-238--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 5, 2026

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-05
Routing: editor — 1 major finding(s); 1 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
Shadow gate: would NOT auto-merge (recorded only; no action taken)


📝 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 modified sections (frontmatter, state-space representation, and computational experiments) is generally accurate, fluent, and terminologically consistent with the glossary. The main concerns are the unrequested change to the covariance matrix LaTeX formatting using \substack (a formatting risk), and additional font-configuration/cross-reference changes in the code and doc reference that go beyond straightforward translation and were not part of the original source content for this PR. These should be verified for correctness and site-wide consistency but do not constitute critical blocking issues for meaning or core structure preservation. Mathematical notation, LaTeX equations, and variable names are preserved accurately across all modified sections Technical narrative explaining innovations representation, Kalman gain, and filtering gain is translated with high fidelity and appropriate academic register Code comments are consistently and naturally translated into Chinese while preserving code functionality

Suggestions:

  • [major · formatting] lectures/kalman_2.md — 'A state-space representation' section: cov_latex block using \substack: The English source uses a standard LaTeX matrix (\begin{bmatrix} ... \end{bmatrix}) for the covariance matrix display in the contour plot title, but the Chinese translation changes this to \left[ \substack{...} \right] with \; separators. This is an unrequested rendering change that risks breaking LaTeX rendering (substack is typically used for subscripts, not matrices, and may render incor… → Restore the original bmatrix formatting: r'$\Sigma_{{{}}}= \begin{{bmatrix}} {:.2f} & {:.2f} \ {:.2f} & {:.2f} \end{{bmatrix}}$'
  • [minor · formatting] lectures/kalman_2.md — Import block after '## A worker's output': The translation adds extra font-configuration code (FONTPATH, mpl.font_manager, plt.rcParams) not present in the English source, and removes the mpl.rcParams['text.usetex'] / text.latex.preamble lines that were in the original. While font setup for CJK rendering may be a legitimate localization need, this is an unannounced structural change to a code cell that alters behavior (switching from … → If this substitution is an intentional, standardized site-wide practice for Chinese notebooks, keep it, but confirm it does not break LaTeX label rendering used elsewhere in the same lecture (e.g., titles with $\mathbb{E}$).
  • [minor · terminology] lectures/kalman_2.md — Import section referencing intermediate lecture: The English source references {doc}\kalman_filter_var`without an intersphinx prefix, but the Chinese translation changes it to{doc}`intermediate:kalman_filter_var`. This is not part of the listed MODIFIED sections' original content and may be an unrequested/inconsistent change to a cross-reference not present in the source text for this PR. → Verify whether 'intermediate:' prefix is required by the site's cross-reference scheme; if not needed, revert to {doc}`kalman_filter_var``.
  • [nit · fluency] lectures/kalman_2.md — '一些计算实验' contour plot code: axs[i].set_title('时间步'+f' {t}'): The string concatenation '时间步'+f' {t}' is a slightly awkward code-level artifact where the original f-string 'time step {t}' was split into a literal Chinese string plus an f-string; while functionally correct, it's stylistically inconsistent with combining directly into a single f-string. → Use a single f-string: f'时间步 {t}'

🔍 Diff Quality

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

Summary: Most changes (NamedTuple class refactor and related prose) were correctly synced, but the jupytext_version bump and one 'namedtuple'→'factory function' terminology update were missed in the target.

Issues:

  • jupytext_version in frontmatter was not updated from 1.16.1 to 1.16.7 to match source
  • Text 'we can change...parameters...in our create_worker namedtuple' was changed to 'factory function' in source, but target still reads '在 create_worker namedtuple 中' instead of using the equivalent of 'factory function' (e.g., 工厂函数)

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 zh-cn kalman_2 lecture to match upstream changes from lecture-python.myst, specifically migrating the WorkerModel definition to a typed NamedTuple for clearer structure and type intent in the embedded code cells.

Changes:

  • Replaced collections.namedtuple usage with a typed typing.NamedTuple class for WorkerModel.
  • Updated surrounding Chinese text to refer to NamedTuple and to correctly describe create_worker as a factory function.
  • Refreshed 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/kalman_2.md Migrates WorkerModel to a typed NamedTuple and updates related prose accordingly.
.translate/state/kalman_2.md.yml Updates translation-sync bookkeeping (source SHA/date/mode/tool version).

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

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 lecture review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants