Skip to content

Translate the GPU admonition (_admonition/gpu.md) - #181

Merged
mmcky merged 1 commit into
mainfrom
translate-gpu-admonition
Nov 16, 2026
Merged

mmcky merged 1 commit into
mainfrom
translate-gpu-admonition

Conversation

@mmcky

@mmcky mmcky commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

This edition held an English copy of the GPU admonition, lectures/_admonition/gpu.md, a fragment that lectures pull in with {include}. This PR replaces it with a Farsi translation and adds its state file, .translate/state/_admonition/gpu.md.yml. Included files are part of each edition's lecture set; see QuantEcon/action-translation#449.

The translation was made with translate init -s <lecture-python-programming> -t <lecture-python-programming.fa> --target-language fa -f _admonition/gpu.md, at action-translation e95b69d (main, which includes 73bd6a8 from QuantEcon/action-translation#456), model claude-sonnet-5, one call of 735 tokens. translate forward could not do this, since it skips a file identical to the source.

The admonition structure is unchanged: one {admonition} GPU block with :class: warning, the same fences, and the Colab link's URL as in the English.

init also copied one non-Markdown file the edition lacks, lectures/_static/lecture_specific/python_advanced_features/test_table.csv; it is left out of this PR.

Matt reviews the Farsi before this merges.

🤖 Generated with Claude Code

The edition held an English copy of this include fragment. Translated
with translate init -f at action-translation e95b69d (claude-sonnet-5).
See QuantEcon/action-translation#449.

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

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for majestic-griffin-10b166 ready!

Name Link
🔨 Latest commit 896a8d3
🔍 Latest deploy log https://app.netlify.com/projects/majestic-griffin-10b166/deploys/6afa7cec0cf50d3bdaf385fe
😎 Deploy Preview https://deploy-preview-181--majestic-griffin-10b166.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.

@mmcky
mmcky merged commit cbbd9be into main Nov 16, 2026
6 checks passed
@mmcky
mmcky deleted the translate-gpu-admonition branch November 16, 2026 03:50
@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request November 16, 2026 03:52 Inactive
mmcky added a commit to QuantEcon/action-translation that referenced this pull request Nov 16, 2026
#370, #449 P4) (#460)

The fourth of #449's PRs, building condition 3 of
D-2026-10-19-sync-scope-existing-reads-state-files on the lecture set
(ruling 7 of D-2026-11-16-the-lecture-set-is-the-toc-and-its-includes),
from the P4 design (draft 2, after its Fable review).

- `translate doctor -t <edition> --require-state` turns the
  .translate/state/ check into the four-item check on the edition's
  lecture set: (a) a lecture with no state file that is not declared,
  (b) a declared exception with a state file, (c) a file under
  .translate/state/ with no lecture, a non-<path>.md.yml file among
  them, and (d) an unreadable state file. Every item is reported at
  once; an orphaned unreadable file counts as orphaned. An UNLISTED
  lecture's state file and a stale exception warn. Without a _toc.yml
  the check fails beside Lecture set. Without the flag nothing changes.
- Every item comes from one listing of the state folder
  (listStateFiles, translate-state.ts), compared with the set as
  strings, so Intro.md.yml for intro.md is missing plus orphaned on
  every filesystem, as on the Linux runner and for sync.
- Exceptions are a mapping under state-exceptions in
  .translate/config.yml, read with CORE_SCHEMA (readStateExceptions
  checks the shape); doctor puts each key in the lecture set's spelling
  with normalizeDocsPath, now exported from lecture-set.ts (renamed
  from normalize, unchanged), and names each unusable key. A
  repo-relative key is named as such. This takes the place of the
  --exclude #370 proposed. TranslateConfig gains the optional key.
- --json: top-level requireState: true; the check's data holds missing,
  declaredWithState, orphaned, corrupt, unlisted, staleExceptions and
  exceptionErrors, sorted. summary keeps its shape.
- checkConfig names a config that does not load, a repeated key with
  its line among them, where it said "missing required fields".

dist-action changes only by the rename and the source map: the action
bundles lecture-set.ts and translate-state.ts but none of the new code,
and translate-state.ts does not import the lecture-set reader, so the
bundle's module order is unchanged.

Decision record D-2026-11-16-require-state-check holds the readings for
@mmcky to confirm and corrects ruling 7: ml's _admonition/gpu.md is
outside ml's lecture set today, and fa's needs no declaration since
QuantEcon/lecture-python-programming.fa#181 translated it; the 2026-11-16
record gets a note pointing there.

Tests: doctor (#370's four cases, (b), (c) nested and non-state files,
orphan over corrupt, case mismatch, unlisted and its corrupt case, stale
exceptions with the ml case, each malformed key, ./ and lectures/ keys,
a bare date, a partial ToC, a fragment, no state folder, no ToC, the
cap, a --json fixture with all six lists), translate-state
(listStateFiles, readStateExceptions, the writeConfig round trip),
status (state-exceptions survives --write-state) and cli-smoke (exit 1,
then 0 once declared). Docs: CLI reference (the flag, the items, the
key, a CI job at a pinned tag, #371), action reference, both tutorials,
FAQ; changelog fragment 370-require-state; STATE.md's count: 2,759
tests across 88 suites.

* doctor: review fixes for --require-state (JSON on every path, wording, keys)

From the Fable review of the first commit, which found no must-fix and
ran the check on all six editions, matching the record:

- --json's `data` holds all seven lists on every path, an edition with
  no lecture set too, as the CLI reference and the record say.
- The record says seven lists (exceptionErrors is the seventh), and
  its readings are put to Matt in the PR body; the record merges only
  on his yes.
- A state file whose .md is in a folder the book never builds from
  (_build, a dot-folder) is "no lecture at its path", not "no such
  .md"; a stale exception the edition lacks reads the same way.
- An empty key and a bare `.md` key are refused by name; a
  docs-folder-prefixed key is named as repo-relative for a file
  outside the set too.
- The docs name `.gitkeep` among the files under state/ that fail
  (c), and the CI example pins actions/checkout@v7, as setup.ts's
  scaffolded workflow and the docs do.

2,762 tests across 88 suites, on d73f874 (v0.32.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WT8bMaeFJpEpdYGkPF9V3h

This branch was previously deployed

1 inactive deployment
pull request — 896a8d31 Deployed Nov 16, 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.

1 participant