[action-translation] resync: newton_method.md#140
Conversation
✅ Deploy Preview for astonishing-narwhal-a8fc64 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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.
| ```{include} _admonition/gpu.md | ||
| ``` |
| 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) |
| 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) |
| 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>
…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>
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-18 📝 Translation Quality
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:
🔍 Diff Quality
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>
#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>
Forward Resync: newton_method.md
Source: QuantEcon/lecture-python.myst — lectures/newton_method.md
Source commit:
6c93e96This 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