Skip to content

[action-translation] resync: newton_method.md#140

Merged
mmcky merged 4 commits into
mainfrom
resync/newton_method
Jul 18, 2026
Merged

[action-translation] resync: newton_method.md#140
mmcky merged 4 commits into
mainfrom
resync/newton_method

Conversation

@mmcky

@mmcky mmcky commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Forward Resync: newton_method.md

Source: QuantEcon/lecture-python.mystlectures/newton_method.md
Source commit: 6c93e96
This PR resyncs the translation to match the current source document.

Reason: The target is an older/different version of this document, using numpy/autograd/scipy instead of jax throughout, with 3000-good example instead of 5000, different code implementations (namedtuple vs NamedTuple, no jax.vmap/jit), no GPU admonition include but a seealso block instead, different tolerance in exercise 2 (1e-15 vs stated 0.0 mismatch), and various omitted/altered explanatory text (e.g., missing bullet-point explanation of Newton's method for fixed points vs zeros in more detail, missing k^*=... display differences). This reflects substantial content differences from an outdated source version rather than mere stylistic differences, requiring re-translation to match current source. It does not clearly add unique substantive content beyond what source has (mostly reflects an older version), so CONTENT_CHANGES is the appropriate verdict rather than TARGET_HAS_ADDITIONS.

Changes

Whole-file resync applied. The entire document was resynced in a single pass.


Created by action-translation forward resync

Copilot AI review requested due to automatic review settings July 18, 2026 08:32
@mmcky mmcky added action-translation-sync CLI resync PR (translate forward --github) resync Forward resync labels Jul 18, 2026
@netlify

netlify Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

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

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 PR forward-resyncs the Chinese translation of lectures/newton_method.md to align with the current upstream lecture content, including switching examples and code cells from numpy/autograd style to jax-based implementations and updating the document structure/metadata.

Changes:

  • Added translation front-matter metadata (title + heading mappings) and refreshed the lecture’s MyST structure.
  • Migrated numerical examples to JAX (jax.numpy, jax.grad, jax.jacobian, jax.jit, jax.vmap) and updated associated code cells/output handling.
  • Added translation sync state tracking in .translate/state/newton_method.md.yml.

Reviewed changes

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

File Description
lectures/newton_method.md Resynced lecture content; moved examples to JAX and updated document structure/metadata.
.translate/state/newton_method.md.yml Records resync metadata (source SHA/date/model/mode).

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

Comment thread lectures/newton_method.md
Comment on lines +47 to 48
```{include} _admonition/gpu.md
```
Comment thread lectures/newton_method.md
Comment on lines 415 to 419
while error > tol:
n += 1
if(n > max_iter):
raise Exception('达到最大迭代次数但未收敛')
if n > max_iter:
raise Exception("Max iteration reached without convergence")
y = q(x)
Comment thread lectures/newton_method.md
Comment on lines 753 to 757
while error > tol:
n+=1
if(n > max_iter):
raise Exception('Max iteration reached without convergence')
n += 1
if n > max_iter:
raise Exception("Max iteration reached without convergence")
y = q(x)
Comment thread lectures/newton_method.md
Comment on lines 83 to 85
import matplotlib.pyplot as plt
import matplotlib as mpl
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
mpl.font_manager.fontManager.addfont(FONTPATH)
plt.rcParams['font.family'] = ['Source Han Serif SC']

from collections import namedtuple
from typing import NamedTuple
from scipy.optimize import root
Re-applies Chinese code comments / print strings / plot labels that the
resync reverted to English while the surrounding code is unchanged
(action-translation#107 field validation, Track B wave).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mmcky mmcky added the action-translation PRs created by QuantEcon/action-translation label Jul 18, 2026
@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 18, 2026 10:30 Inactive
mmcky added a commit that referenced this pull request Jul 18, 2026
…fiscal ref

mix_model kept a CJK font-config block without the mpl import it needs
(same class as the five wave-branch fixes; mix_model was skipped by the
wave so the pre-existing bug stayed on main). cass_fiscal's note pointed
{doc} at a document that never existed; replaced with the wave branch's
exact {ref}`growth_model` sentence so the resync PR merges cleanly over
it. newton_method's two iref_ambiguous warnings are NOT patched here:
old main lacks the local anchors, and the resync PR (#140) adds them -
merging #140 resolves those warnings without conflict-prone edits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-18


📝 Translation Quality

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

Summary: This is a high-quality, comprehensive translation that accurately conveys the technical content of the Newton's method lecture. Mathematical notation, code blocks, and MyST directives are all correctly preserved. Terminology is largely consistent with the glossary. Minor issues include some inconsistency in external link sources (Baidu Baike vs Wikipedia) and one instance where a plot title translation slightly diverges from the literal source phrasing. No syntax errors were found. Comprehensive and accurate translation of technical/mathematical content including Newton's method derivations and equations Consistent use of established terminology from the glossary (牛顿法, 索洛模型, 不动点, 稳态, 雅可比矩阵, etc.) Code comments and print statements properly translated while preserving code functionality Math equations, LaTeX formatting, and MyST directives preserved correctly throughout Natural and fluent academic Chinese register maintained across long technical passages

Suggestions:

  • External links changed from Wikipedia English links to Baidu Baike Chinese links (e.g., '不动点', '零点', '牛顿迭代法', '雅可比矩阵'): while acceptable for accessibility, this diverges from source URLs; consider using zh.wikipedia.org links where available (as done for '稳态') for consistency across the document
  • '稳态' link uses zh.wikipedia.org while other similar terms use baike.baidu.com - inconsistent link source choice within the same resynced document (e.g., 不动点/零点/牛顿法 vs 稳态/索洛模型/雅可比矩阵)
  • Section '#### 使用多维根查找器' - missing blank line after heading before paragraph compared to other subsections' spacing pattern, though this is a minor stylistic inconsistency and does not affect rendering
  • In 'plot_excess_demand' function, the title translation 'f"超额需求函数 {good}"' loses the original phrasing 'Excess demand for good {good}' - a more accurate translation would be 'f"商品{good}的超额需求"' to match the meaning precisely and align with earlier translated print statements like '商品0的超额需求'

🔍 Diff Quality

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

Summary: The target document was correctly resynced to match the current English source, with all structural changes (JAX migration, new anchors, admonition include, text updates) properly positioned and translated, and the heading map accurately reflects the nested heading hierarchy.


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

The localisation sweep transplanted the exercise-solution print line
('尝试 {attempt}...') into the multivariate newton() loop where neither
variable exists - a NameError the review caught. Correct line matches
the one-dimensional cell: 迭代 {n}, 误差. Also restores the standard
font-config block the resync dropped while keeping Chinese plot labels.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pull request July 18, 2026 11:30 Inactive
@mmcky
mmcky merged commit bc47ebf into main Jul 18, 2026
7 checks passed
@mmcky
mmcky deleted the resync/newton_method branch July 18, 2026 23:16
mmcky added a commit that referenced this pull request Jul 18, 2026
#97) (#166)

* CI hardening: strict builds, conda dependabot, missing wald_dec_rule.png

Carries forward the pieces of #97 that #165 did not supersede:

- jb build gains '-n -W --keep-going' in cache/ci/publish workflows,
  matching the English source repos' strict-build convention
- dependabot watches the conda ecosystem (jupyter-book pinned <2.0,
  python constrained by the anaconda distribution)
- wald_dec_rule.png copied from the source repo (referenced by
  wald_friedman_2 but absent here - a warning today, an error under -W)

Dropped from #97 as obsolete: the lecture-code fixes (regenerated by the
Track B resync wave or applied directly to its branches) and the ogm.py
tweak (optgrowth_fast was removed in #99).

Part of Phase 0 Track B, QuantEcon/lecture-python.myst#947.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix the two main-content strict-build breaks: mix_model import, cass_fiscal ref

mix_model kept a CJK font-config block without the mpl import it needs
(same class as the five wave-branch fixes; mix_model was skipped by the
wave so the pre-existing bug stayed on main). cass_fiscal's note pointed
{doc} at a document that never existed; replaced with the wave branch's
exact {ref}`growth_model` sentence so the resync PR merges cleanly over
it. newton_method's two iref_ambiguous warnings are NOT patched here:
old main lacks the local anchors, and the resync PR (#140) adds them -
merging #140 resolves those warnings without conflict-prone edits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 action-translation-sync CLI resync PR (translate forward --github) resync Forward resync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants