Skip to content

Recover six small gaps: five state-file advances and harrison_kreps' la.solve port - #301

Merged
mmcky merged 3 commits into
mainfrom
recover/state-advance-760-977
Oct 22, 2026
Merged

mmcky merged 3 commits into
mainfrom
recover/state-advance-760-977

Conversation

@mmcky

@mmcky mmcky commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Part of #298: the six small gaps, recovered without regenerating any lecture. Five lectures already carry their source change and only their .translate/state sha was stale; one needed a seven-line code port.

Lecture Source change behind What this PR does
career, jv, odu QuantEcon/lecture-python.myst#760 changed only the H1 (Job Search renumbering) state only: #273 applied it, the H1s read VII, VIII, IX
mccall_q QuantEcon/lecture-python.myst#760, H1 only (IX → X) state only: applied by #273; the earlier default_rng and typo/legend changes are present too
likelihood_bayes QuantEcon/lecture-python.myst#977, np.random seed → default_rng state only: #248 delivered it at the same two sites as the source
harrison_kreps QuantEcon/lecture-python.myst#669, explicit inverse → la.solve (its sync failed before filing anything) ports the seven lines by hand, comments translated, and advances the state

Each was re-verified on 2026-10-22 against the source diff between its old state sha and the file's current sha. The 2026-10-18 truth table had mccall_q down for forward -f; the diff shows only the H1 outstanding. State-only changes advance source-sha and stamp synced-at, leaving model, mode, section-count and tool-version as they were (the convention of QuantEcon/lecture-python-programming.fa#160).

Checks. harrison_kreps's code matches the source (ASTs with string literals masked) and the lecture executes locally with numerical output identical to the English. translate status at v0.29.6 against lecture-python.myst main reports all six ALIGNED.

What #298 still has after this: the lectures in #286, #294 and #296; measurement_models (no human edits, so a fresh init -f); and sir_model, svd_intro, var_dmd, which carry the zh-cn editors' work and whose route is still open.

🤖 Generated with Claude Code

mmcky and others added 3 commits October 22, 2026 10:22
career, jv and odu: QuantEcon/lecture-python.myst#760 changed only the
H1 in each (Job Search renumbering), and #273 applied it here. The
H1s on main already read VII, VIII and IX.

likelihood_bayes: QuantEcon/lecture-python.myst#977 replaced the
global np.random seed with default_rng; #248 delivered that change, and
the file uses np.random.default_rng(142857) at the same two sites as
the source, but the state kept the older sha.

source-sha advanced to each file's last source commit and synced-at
stamped; model, mode, section-count and tool-version are left as they
were, since nothing was regenerated (the fa#160 convention).
`translate status` at v0.29.6 now reports all four ALIGNED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The state sha is 46cf999 (QuantEcon/lecture-python.myst#624). The only
later source change is QuantEcon/lecture-python.myst#760, which changed
just the H1 (Job Search IX -> X); #273 applied it, and the H1 here
reads 工作搜寻 X. The earlier default_rng change (QuantEcon/lecture-python.myst#959) and
QuantEcon/lecture-python.myst#624's typo, legend and loop-guard edits
are present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tate

QuantEcon/lecture-python.myst#669 replaced the explicit inverse in
price_single_beliefs with a linear solve. Its sync failed before it
could file anything (a missing anthropic-api-key input on 2026-08-05),
so the change never arrived. The source diff is seven lines of code in
one cell, so it is ported by hand rather than regenerating a lecture
the zh-cn editor has worked on: the code is the source's, and the three
comments are translated as this edition translates code comments.

The cell's code now matches the source (ASTs with string literals
masked); the lecture executes with numerical output identical to the
English. source-sha advanced and synced-at stamped; model, mode,
section-count and tool-version unchanged, as nothing was regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 00:35
@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for astonishing-narwhal-a8fc64 ready!

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

🟢 Approval recommended

The only code change is a verified mathematically-equivalent la.solve port with correct comments, and the remaining changes are low-risk state-file metadata advances consistent with the documented convention.

No open issues 🎉

What changed in this PR

This PR recovers six small gaps identified in issue #298 without regenerating any lecture. Five translated lectures (career, jv, odu, mccall_q, likelihood_bayes) already carried their source content changes but had stale .translate/state tracking files, so only their source-sha/synced-at are advanced. The sixth, harrison_kreps, needed a seven-line code port backporting the upstream refactor from an explicit matrix inverse (la.inv) to a linear solve (la.solve), which is mathematically equivalent (prices = β·(I−βP)⁻¹·P·d ⇒ solve(I−βP, β·P·d)).

Changes:

  • Port price_single_beliefs in harrison_kreps.md from la.inv(...) @ ... to la.solve(A, b), with translated comments.
  • Advance source-sha and synced-at on five state files, preserving model/mode/section-count.
File Description
lectures/​harrison_kreps.md Rewrites price_single_beliefs to use la.solve; equivalent result, correct translated comments.
.translate/​state/​harrison_kreps.md.yml Advances state to the source sha carrying the la.solve refactor.
.translate/​state/​likelihood_bayes.md.yml Advances source-sha to 06c784f5… (matches PR #248's source commit).
.translate/​state/​career.md.yml Advances state sha for the Job Search renumbering (H1-only source change).
.translate/​state/​jv.md.yml Advances state sha for the Job Search renumbering.
.translate/​state/​odu.md.yml Advances state sha for the Job Search renumbering (mode: RESYNC preserved).
.translate/​state/​mccall_q.md.yml Advances state sha; content (H1, default_rng, typos) already present.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request October 22, 2026 00:42 Inactive
@mmcky
mmcky merged commit dd0ccdd into main Oct 22, 2026
8 checks passed
@mmcky
mmcky deleted the recover/state-advance-760-977 branch October 22, 2026 01:27

This branch was previously deployed

1 inactive deployment
pull request — 4fcb3220 Deployed Oct 22, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants