Skip to content

Fix learning_approximation FONTPATH: _fonts/ → fonts/ (unbreaks the cache build) - #262

Open
mmcky wants to merge 1 commit into
mainfrom
fix/learning-approximation-fontpath
Open

Fix learning_approximation FONTPATH: _fonts/ → fonts/ (unbreaks the cache build)#262
mmcky wants to merge 1 commit into
mainfrom
fix/learning-approximation-fontpath

Conversation

@mmcky

@mmcky mmcky commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

One-line fix for the failure that blocked today's publish: the 2026-08-20 cache.yml run (32331172292) failed on Build HTML with

FileNotFoundError: [Errno 2] No such file or directory: '_fonts/SourceHanSerifSC-SemiBold.otf'

while executing learning_approximation.md's import cell.

Cause — a known seed gotcha, missed in #261

The engine's i18n-font-config localisation rule hard-codes _fonts/; this edition keeps the font at lectures/fonts/. Every other font-loading lecture here uses fonts/116 references across 36 lectures, against this single _fonts/ one. Repointing the path was the one documented seed-gotcha the #261 gap-fill missed: its verification checked the font block was present but not the path.

Why it slipped past CI: #261's PR preview build tolerated the CellExecutionError as a mystnb warning and passed, so the defect surfaced only when the strict cache build executed the lecture. (My post-merge note on #261 claiming the build "executed all 17 code cells" was therefore too strong — the run completed, but this cell's failure was warned, not raised. The cache build is the real gate.)

Verification

  • git grep '_fonts' -- lectures/ after the change: zero occurrences.
  • The asset exists at lectures/fonts/SourceHanSerifSC-SemiBold.otf.
  • The identical block form is what mobility.md uses on lecture-intro.zh-cn, whose cache build passed today with the lecture executing.

Sequencing

On merge, cache.yml needs a dispatch (the failed run left no fresh artifact), and once green publish-2026aug20 can be tagged — intro.zh-cn's tag is already pushed and publishing. Recorded on zh-cn#210's successor trail via the work plan.

…cache build)

The 2026-08-20 cache.yml run (32331172292) failed on Build HTML with
FileNotFoundError: '_fonts/SourceHanSerifSC-SemiBold.otf' while executing
learning_approximation.md's import cell. The engine's i18n-font-config rule
hard-codes _fonts/; this edition keeps the font at lectures/fonts/, and every
other font-loading lecture here (116 references across 36 lectures) uses
fonts/. This was the one known seed gotcha the #261 gap-fill missed — the PR
preview build tolerated the execution error as a warning, so it surfaced only
when the strict cache build ran.

One-line change; the asset exists at lectures/fonts/SourceHanSerifSC-SemiBold.otf.

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

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

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

Updates the i18n Matplotlib font path in learning_approximation to match the repository’s established lectures/fonts/ layout, preventing cache/strict execution builds from failing due to a missing _fonts/ directory.

Changes:

  • Repoint FONTPATH from _fonts/SourceHanSerifSC-SemiBold.otf to fonts/SourceHanSerifSC-SemiBold.otf in the lecture’s import cell.

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

@github-actions

Copy link
Copy Markdown

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