Skip to content

Resync hoist_failure.md to source a7aafd5b (recovers the 2026-08-05 sync failure) - #260

Merged
mmcky merged 1 commit into
mainfrom
recover/hoist-failure
Aug 20, 2026
Merged

Resync hoist_failure.md to source a7aafd5b (recovers the 2026-08-05 sync failure)#260
mmcky merged 1 commit into
mainfrom
recover/hoist-failure

Conversation

@mmcky

@mmcky mmcky commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Brings hoist_failure.md up to source a7aafd5b. It has been one commit behind since 2026-08-05.

Why it was behind

The sync of lecture-python.myst#656 failed with Update mode requires oldEnglish, newEnglish, and currentTranslation, filed as lecture-python.myst#1028 — one of fifteen translation-sync-failure issues that were open across the estate, none of them ever answered. This is the one whose error is not a structural-parity failure, which is why it was the best candidate to simply retry.

How it was delivered

translate forward -f hoist_failure.md at engine v0.26.0, not \translate-resync. Per the 2026-08-20 ruling on action-translation#276 the CLI is the documented recovery route: it reads source off the local filesystem, so it cannot carry a stale merge-time snapshot, and its parity check is anchored to current main.

Why the diff is large

Because the source change was. #656 ("Clean up the code and correct minor errors") rewrote the English lecture by 567 insertions and 426 deletions — it restructured the imports, retitled sections and reworked most of the prose. So the target is re-derived rather than patched, and the 941-line target diff is proportionate to the 993-line source diff it is tracking.

Verification

Check Result
directives 46 / 46 vs source
code cells 23 / 23
headings 52 / 52
python syntax across all 23 cells 0 errors — matching source exactly
captions byte-identical to source none
axis labels byte-identical to source none
i18n font block preserved byte-for-byte through the regeneration

The font block surviving is worth calling out: forward warned that the target carried "content not in SOURCE" and named that block, so it was at risk of being dropped as a target-only addition. It came through intact, but it is the first thing to check on any future whole-file resync of this edition.

Review note

This is a whole-file regeneration, so the prose is entirely re-translated rather than patched — worth a read for terminology drift against the rest of the edition, particularly around 对数正态 / 卷积 / 故障率.

State advances to source-sha: a7aafd5b, mode: RESYNC, tool-version: 0.26.0.

The sync of source PR QuantEcon/lecture-python.myst#656 failed on 2026-08-05
with "Update mode requires oldEnglish, newEnglish, and currentTranslation",
recorded as lecture-python.myst#1028 and never retried. The lecture has been
one commit behind since.

Recovered with `translate forward -f` at engine v0.26.0 rather than
\translate-resync, per the 2026-08-20 ruling on
QuantEcon/action-translation#276: forward reads source off the local
filesystem, so it cannot carry a stale merge-time snapshot, and it anchors
its parity check to current main.

The diff is large because the source change was: #656 rewrote the English
lecture by 567 insertions and 426 deletions, so the target is re-derived
rather than patched.

Verified against source: 46/46 directives, 23/23 code cells, 52/52 headings,
0 python syntax errors across all 23 cells (matching source), no captions or
axis labels byte-identical to source, and the edition's i18n font block
preserved byte-for-byte through the regeneration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 20, 2026 02:08
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit 8e9c821
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a86619aeb6faf0008f6e08c
😎 Deploy Preview https://deploy-preview-260--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 resynchronizes the Chinese translation of lectures/hoist_failure.md to the updated upstream English source (a7aafd5b) after a previously failed sync, and updates translation state metadata accordingly.

Changes:

  • Regenerates lectures/hoist_failure.md content and notebook structure to match the latest source lecture (headings, prose, code cells, and figures).
  • Updates translation state tracking to the new source SHA, sync date, mode, and tool version.

Reviewed changes

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

File Description
lectures/hoist_failure.md Whole-file regeneration of the lecture translation content and embedded notebook cells/figures.
.translate/state/hoist_failure.md.yml Updates translation sync metadata (source SHA, timestamp, model, section count, tool version).
Suppressed comments (2)

lectures/hoist_failure.md:748

  • Quantile extraction currently indexes into x, but cdf is defined over system_pmf (post-13 convolutions), so the index returned by find_nearest(cdf, q) can exceed len(x) and crash. Use the same extended grid as the CDF (x_system) when converting CDF indices to x-values.
# 查找分位数
quantiles = [0.01, 0.05, 0.10, 0.50, 0.665, 0.85, 0.90, 0.95, 0.99, 0.9978]
quantile_values = [x[find_nearest(cdf, q)] for q in quantiles]

lectures/hoist_failure.md:818

  • In the exercise solution, cdf_test is computed from system_test (after many convolutions) but the median is read from x_test, which only matches a single component grid. This can raise IndexError and gives the wrong median location. Create an extended grid for system_test and use it for the median lookup.
    # 计算中位数
    cdf_test = np.cumsum(system_test)
    median = x_test[find_nearest(cdf_test, 0.5)]


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lectures/hoist_failure.md
Comment on lines +34 to +57
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.10.3
kernelspec:
display_name: Python 3
language: python
name: python3
translation:
title: 故障树不确定性
headings:
Overview: 概述
The lognormal distribution: 对数正态分布
The convolution theorem: 卷积定理
Approximating continuous distributions: 近似连续分布
Discretizing the lognormal distribution: 离散化对数正态分布
Convolving probability mass functions: 概率质量函数的卷积
Fault tree analysis: 故障树分析
Failure rates unknown: 未知的故障率
Application: waste hoist failure rate: 应用:废物提升机失效率
Exercises: 练习
---
Comment thread lectures/hoist_failure.md
Comment on lines +722 to +728
# 计算累积分布函数
cdf = np.cumsum(system_pmf)

# 绘制累积分布函数
Nx = 1400
fig, ax = plt.subplots(figsize=(10, 6))
ax.plot(x[:int(Nx / m)], cdf[:int(Nx / m)], 'b-', lw=2)
@mmcky
mmcky merged commit 063669d into main Aug 20, 2026
7 checks passed
@mmcky
mmcky deleted the recover/hoist-failure branch August 20, 2026 03:07
@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 20, 2026 03:15 Inactive
@mmcky

mmcky commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Post-merge note: the build that was still in flight when this merged has since passedrun 32323568162, 1h06m, Build Download Notebooks (sphinx-tojupyter) success and Build HTML success, completing at 03:15:17Z (about 8 minutes after the merge).

That is worth recording because this edition's ci.yml is on: [pull_request] only, so nothing rebuilds main afterwards — had it failed, no run would have surfaced it. It also upgrades the verification: the pre-merge checks were static (directive counts, ast.parse over the code cells), whereas this executed all 23 code cells of the regenerated hoist_failure.md and rendered the HTML.

Upload Execution Reports shows skipped, which is the success path — the reports upload only on failure.

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