Skip to content

🌐 [translation-sync] Misc edits to need for speed and related lectures#20

Open
mmcky wants to merge 4 commits intomainfrom
translation-sync-2026-04-10T19-33-03-pr-521
Open

🌐 [translation-sync] Misc edits to need for speed and related lectures#20
mmcky wants to merge 4 commits intomainfrom
translation-sync-2026-04-10T19-33-03-pr-521

Conversation

@mmcky
Copy link
Copy Markdown
Contributor

@mmcky mmcky commented Apr 10, 2026

Automated Translation Sync

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

Source PR

#521 - Misc edits to need for speed and related lectures

Files Updated

  • ✏️ lectures/need_for_speed.md
  • ✏️ .translate/state/need_for_speed.md.yml
  • ✏️ lectures/numba.md
  • ✏️ .translate/state/numba.md.yml

Details

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

This PR was created automatically by the translation action.

@github-actions
Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-4-6 | Date: 2026-04-10


📝 Translation Quality

Criterion Score
Accuracy 9/10
Fluency 9/10
Terminology 9/10
Formatting 9/10
Overall 9/10

Summary: The translation is of high quality overall, accurately conveying the technical content of both the scientific computing overview and Numba lecture. Terminology is consistent and follows established conventions. The formatting is well-preserved with no syntax errors. Minor issues include a slightly imprecise translation of 'routines' as '程序' rather than '例程', and a few mildly literal phrasings that could be made more idiomatic. These are minor concerns in an otherwise excellent translation. Technical terminology is consistently and accurately translated throughout, including specialized terms like JIT compilation (即时编译), vectorization (向量化), multithreading (多线程), and multiprocessing (多进程) Mathematical equations and LaTeX formatting are perfectly preserved across all modified sections Code blocks, MyST directives, cross-references, and structural formatting are all correctly maintained The translation reads naturally in academic Chinese with appropriate register, avoiding overly literal constructions in most places Economic and financial terminology follows the reference glossary correctly, e.g., '贴现因子', '随机波动率', '行权价', '总回报率'

Suggestions:

  • Overview (first document), bullet point 4: '该语言及其库均为开源' → '该语言及其库均为开源项目' — adding '项目' makes the phrase more natural and complete in Chinese

  • Why do we need them?, 'scientific libraries provide the routines we don't want to -- and probably shouldn't -- write oursives' (source has typo 'oursives'): translation '科学库提供了我们不想——也可能不应该——自己编写的程序' uses '程序' (programs) where '例程' or '函数' would be more accurate for 'routines' in this context

  • Summary (first document): 'On that note, we emphasize that, in the last few years, accelerating code has become essentially synonymous with parallelization.' → translated as '在这一点上,我们强调,在过去几年中,加速代码基本上已经与并行化同义。' — '在这一点上' is a somewhat literal rendering of 'On that note'; '就此而言' or '在此背景下' would sound more natural in Chinese academic writing

  • A Gotcha: Global Variables: 'When Numba compiles machine code for functions, it treats global variables as constants to ensure type stability.' → '当 Numba 为函数编译机器码时,它将全局变量视为常量,以确保类型稳定性。' — '类型稳定性' is acceptable but '类型一致性' might better convey the intended meaning of type stability in JIT compilation context

  • Multithreaded Loops in Numba: 'Notice that we parallelize across households rather than over time -- updates of an individual household across time periods are inherently sequential' → '注意,我们是跨家庭进行并行化,而非跨时间——单个家庭跨时期的更新本质上是顺序的。' — the em dash rendering is correct but '而不是跨时间步' might be clearer than '而非跨时间' to emphasize time steps


🔍 Diff Quality

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

Summary: Translation changes correctly mirror all source document modifications, including section rewrites, removals of 'Compiling Classes' and 'Caching Compiled Code' sections, and heading map updates in both files.


This review was generated automatically by action-translation review mode.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Automated translation sync updating the zh-cn versions of the “Need for Speed” and “Numba” lectures to match upstream edits, plus updating translation state metadata.

Changes:

  • Refreshed zh-cn lecture content in need_for_speed.md and numba.md to align with upstream structure and wording changes.
  • Removed the “编译类 / Compiling Classes” section from numba.md and adjusted the translation frontmatter headings accordingly.
  • Updated .translate/state/*.yml source SHA, sync date, mode, section counts, and tool version.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
lectures/need_for_speed.md Updates zh-cn lecture prose and structure around scientific libraries and parallelization.
lectures/numba.md Updates zh-cn lecture prose and examples; removes class-compilation section; revises headings mapping.
.translate/state/need_for_speed.md.yml Records new upstream SHA and sync metadata for this lecture.
.translate/state/numba.md.yml Records new upstream SHA and sync metadata for this lecture.

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

Comment on lines +130 to +131
1. JIT 编译:在运行时将类 Python 语句转换为快速机器码的编译器
2. 并行化:将任务分配到多个线程 / CPU / GPU / TPU
多进程是指使用多个处理器并发执行多个进程。

在这个语境中,**进程**是一系列指令(即一个程序)。
多进程是指使用多个处理器并发执行多条逻辑线程。
此外,Numba 还可以完成其他有用的技巧,例如 {ref}`多线程 <multithreading>` 或通过 `numba.cuda` 与 GPU 进行交互

它通过一种称为**即时(JIT)编译**的技术来实现这一点
Numba 的 JIT 编译器在许多方面与 JULIA 中的 JIT 编译器类似

```{code-cell} ipython3
time1 / time3 # 计算速度提升倍数
time1 / time3 # Calculate speed gain
Comment on lines 366 to 375
"""
Updates household wealth.
"""

# 抽取冲击
R = np.exp(v1 * randn()) * (1 + r)
y = np.exp(v2 * randn())
# Draw shocks
R = np.exp(v1 * np.random.randn()) * (1 + r)
y = np.exp(v2 * np.random.randn())

# 更新财富
# Update wealth
w = R * s * w + y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants