You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build, preview and publish the edition as lectures land #1
This edition grows one lecture at a time. Each lecture arrives in its own pull request, where its translator reviews it; when the translator says on the PR that the review is complete, @mmcky reviews the suggestions, updates the lecture and the engine before the next lecture is drafted, and merges the PR. This issue sets up the build for that. Until all 27 pages are on main, the table of contents names lectures that do not exist yet, and cross-references dangle. So the stack copies the one the Malayalam edition uses for the same situation (QuantEcon/lecture-python-programming.ml#6). The ToC is pruned at build time, the build is not strict, every PR gets a rendered preview, and every push to main publishes. The site goes live at the default Pages URL, https://quantecon.github.io/lecture-python-programming.ja/, but no language switcher links to it until every lecture has been reviewed and the edition is announced.
The same PR carries the book's root page, intro.md, generated with the engine release that adds Japanese (QuantEcon/action-translation#340). Chihiro reviews it on that PR as a warm-up: it is two sentences and the table of contents. The PR body carries a closing line for the intro review item, #2, so merging the PR completes that item. This issue stays open after the merge and is closed by hand once the checks that can only run then have passed: the site serving the Japanese root page, and the PR's preview removed. The stack can be prepared before the release, and the PR opens for review once intro.md has been generated.
ci.yml builds each PR and deploys the result to /pr-N/ on the gh-pages branch, then comments with links to the rendered pages the PR changes, and removes the preview when the PR closes. publish.yml builds main and deploys it to the root of gh-pages on every push. reap-previews.yml runs weekly and removes previews whose PR has closed.
Keep what the ml files explain in their comments: set -eo pipefail in every build step, one gh-pages concurrency group shared by all three workflows, keep_files: true on the main deploy (without it, each push wipes the open previews), and no cname input.
Previews deploy for branches in this repository. A PR from a fork builds but does not deploy. There is no Netlify site and no secret: everything runs on the built-in GITHUB_TOKEN.
The build runs jb build lectures --path-output ./ --keep-going, without -n -W, after scripts/prune_toc.py drops the ToC entries whose file is missing (keeping order and captions). Both change when the last lecture lands: the build becomes strict and the prune step goes.
There is no execution cache (fr has cache.yml), so every build executes every lecture present, and build time grows as lectures land.
lectures/_config.yml
translate init copies the English file. Repoint it as below. Each key was checked against the fr and ml configs on 2026-10-01.
removed: there is no notebooks repository, and the theme skips notebook-launch links when it is unset
fr, ml
languages, current_language
en, fa, fr, ja, zh-cn; ja. Only this site lists ja until the edition is announced
ml lists itself the same way
translators, translators_label
Chihiro Watanabe and Kenko Li, each as a name (a url is optional); a Japanese label
ml uses translators; both options are in quantecon-book-theme 0.22.0
tojupyter_urlpath, tojupyter_image_urlpath
the .ja site URL, and the same with _static/
fr, ml
html_theme_options.analytics
removed while the edition is unannounced: it is the English site's property
ml (fr kept it)
No web-font stylesheet is needed (ml loads one for Malayalam). With language: ja, browsers choose Japanese system fonts.
lectures/_toc.yml
Translate the six part captions: Introduction to Python, Foundations of Scientific Computing, High Performance Computing, Working with Data, More Python Programming, Other. No programming edition has localised them yet.
@mmcky drafts them from the glossary and house style; the translators can suggest changes on this PR.
This file is an {include} used by jax_intro, numpy_vs_numba_vs_jax and autodiff. It is not in the ToC, so translate init never delivers it. Copy the English file now, as ml did. Its Japanese version goes in with the first round that includes it (jax_intro, #22), where Kenko reviews it.
intro.md
Generate it with the engine's CLI built at the release tag (npm run build:cli in a checkout of the tag; shown below as translate). SOURCE is a clone of QuantEcon/lecture-python-programming at main, and TARGET is a clone of this repository. The page has no code cells, so the code-cell localisation option, --localize, does not affect it.
translate init -s SOURCE -t TARGET --target-language ja -f intro.md
Commit lectures/intro.md with .translate/state/intro.md.yml. The PR body states the provenance (source commit, engine version, model), as every round does.
translate init copies every non-Markdown file from the English lectures/ folder, even with -f. This PR is the one time to take that copy, as the base for the edits above. Every later round restores what init overwrote (_config.yml, _toc.yml, .translate/config.yml) and drops TRANSLATION-REPORT.md. It then commits the lecture with its state file, plus any new _static asset the lecture uses.
The first preview deploy creates the gh-pages branch. Then serve Pages from it, as ml does: branch gh-pages, folder /, default URL, no custom domain.
gh api -X POST repos/QuantEcon/lecture-python-programming.ja/pages -f 'source[branch]=gh-pages' -f 'source[path]=/'
Done when
Chihiro has approved the PR and mentioned @mmcky, completing the review of intro.md.
@mmcky has reviewed the suggestions, updated intro.md and the engine, and merged the PR, which completes Review: intro.md #2.
The PR's own preview deployed under /pr-N/ with a comment linking it. Once the PR has closed, that directory is gone from gh-pages; the weekly reap-previews.yml removes it if the close-time cleanup did not run.
This edition grows one lecture at a time. Each lecture arrives in its own pull request, where its translator reviews it; when the translator says on the PR that the review is complete, @mmcky reviews the suggestions, updates the lecture and the engine before the next lecture is drafted, and merges the PR. This issue sets up the build for that. Until all 27 pages are on
main, the table of contents names lectures that do not exist yet, and cross-references dangle. So the stack copies the one the Malayalam edition uses for the same situation (QuantEcon/lecture-python-programming.ml#6). The ToC is pruned at build time, the build is not strict, every PR gets a rendered preview, and every push tomainpublishes. The site goes live at the default Pages URL, https://quantecon.github.io/lecture-python-programming.ja/, but no language switcher links to it until every lecture has been reviewed and the edition is announced.The same PR carries the book's root page,
intro.md, generated with the engine release that adds Japanese (QuantEcon/action-translation#340). Chihiro reviews it on that PR as a warm-up: it is two sentences and the table of contents. The PR body carries a closing line for the intro review item, #2, so merging the PR completes that item. This issue stays open after the merge and is closed by hand once the checks that can only run then have passed: the site serving the Japanese root page, and the PR's preview removed. The stack can be prepared before the release, and the PR opens for review onceintro.mdhas been generated.What the PR contains
.github/workflows/ci.yml.github/workflows/publish.yml.github/workflows/reap-previews.ymlscripts/prune_toc.pyenvironment.ymldefaults; quantecon-book-theme 0.22.0).github/dependabot.ymllectures/_config.ymltranslate initlectures/_toc.ymltranslate initlectures/_static/translate initlectures/_admonition/gpu.mdlectures/intro.mdand.translate/state/intro.md.ymltranslate init -f intro.mdat the releaseREVIEWING.mdmain(committed during set-up)Workflows
ci.ymlbuilds each PR and deploys the result to/pr-N/on thegh-pagesbranch, then comments with links to the rendered pages the PR changes, and removes the preview when the PR closes.publish.ymlbuildsmainand deploys it to the root ofgh-pageson every push.reap-previews.ymlruns weekly and removes previews whose PR has closed.ci.yml's comment step atlecture-python-programming.ja. Add fr's pinned JAX install step (pip install "jax==0.11.0") toci.ymlandpublish.yml: jax 0.11.1 hangs thelax.fori_loopcells ofnumpy_vs_numba_vs_jaxon CPU, and the programming family pins 0.11.0 (jax 0.11.1: XLA:CPU dynamic-update-slice-in-loop regression (why jax is pinned to 0.11.0) lecture-python-programming#622 records why; the English CI pin is Pin jax to 0.11.0 in CI — jax 0.11.1 hangs the fori_loop cells on CPU lecture-python-programming#617). Adding the step now means the High Performance Computing lectures build when they arrive.set -eo pipefailin every build step, onegh-pagesconcurrency group shared by all three workflows,keep_files: trueon the main deploy (without it, each push wipes the open previews), and nocnameinput.GITHUB_TOKEN.jb build lectures --path-output ./ --keep-going, without-n -W, afterscripts/prune_toc.pydrops the ToC entries whose file is missing (keeping order and captions). Both change when the last lecture lands: the build becomes strict and the prune step goes.cache.yml), so every build executes every lecture present, and build time grows as lectures land.lectures/_config.ymltranslate initcopies the English file. Repoint it as below. Each key was checked against the fr and ml configs on 2026-10-01.execute.timeout1800, as headroom: fr raised it from 600 on 2026-08-19 (QuantEcon/lecture-python-programming.fr#36) during the jax 0.11.1 incident, whose real cause was jax itself; with jax pinned to 0.11.0,numpy_vs_numba_vs_jaxexecutes in seconds (QuantEcon/lecture-python-programming#622)html.baseurlhttps://quantecon.github.io/lecture-python-programming.ja/latex.latex_documents.targetnamequantecon-python-programming-ja.texsphinx.config.languageja: gives<html lang="ja">, Japanese interface strings and Japanese searchhtml_theme_options.repository_urlhttps://github.com/QuantEcon/lecture-python-programming.jahtml_theme_options.nb_repository_urllanguages,current_languageja. Only this site lists ja until the edition is announcedtranslators,translators_labelname(aurlis optional); a Japanese labeltranslators; both options are in quantecon-book-theme 0.22.0tojupyter_urlpath,tojupyter_image_urlpath.jasite URL, and the same with_static/html_theme_options.analyticsNo web-font stylesheet is needed (ml loads one for Malayalam). With
language: ja, browsers choose Japanese system fonts.lectures/_toc.yml_toc.ymlreplaces the file with the English one and the captions revert (Sync overwrites localised _toc.yml part captions with English, and nothing detects it action-translation#254), so they would need restoring by hand.lectures/_admonition/gpu.mdThis file is an
{include}used byjax_intro,numpy_vs_numba_vs_jaxandautodiff. It is not in the ToC, sotranslate initnever delivers it. Copy the English file now, as ml did. Its Japanese version goes in with the first round that includes it (jax_intro, #22), where Kenko reviews it.intro.mdGenerate it with the engine's CLI built at the release tag (
npm run build:cliin a checkout of the tag; shown below astranslate).SOURCEis a clone of QuantEcon/lecture-python-programming atmain, andTARGETis a clone of this repository. The page has no code cells, so the code-cell localisation option,--localize, does not affect it.lectures/intro.mdwith.translate/state/intro.md.yml. The PR body states the provenance (source commit, engine version, model), as every round does.translate initcopies every non-Markdown file from the Englishlectures/folder, even with-f. This PR is the one time to take that copy, as the base for the edits above. Every later round restores whatinitoverwrote (_config.yml,_toc.yml,.translate/config.yml) and dropsTRANSLATION-REPORT.md. It then commits the lecture with its state file, plus any new_staticasset the lecture uses.action-translationlabel on this PR or on any round PR. That label starts the automated review, which fails on hand-opened PRs (Seed PRs have no AI-review path: init has no --github mode and review mode hard-fails on hand-staged seeds action-translation#218).Pages (repository admin: @mmcky)
The first preview deploy creates the
gh-pagesbranch. Then serve Pages from it, as ml does: branchgh-pages, folder/, default URL, no custom domain.Done when
intro.md.intro.mdand the engine, and merged the PR, which completes Review: intro.md #2./pr-N/with a comment linking it. Once the PR has closed, that directory is gone fromgh-pages; the weeklyreap-previews.ymlremoves it if the close-time cleanup did not run.<html lang="ja">.lectures/_config.ymlcarries the values in the table,lectures/_toc.ymlcarries six Japanese captions, andlectures/_admonition/gpu.mdis present.REVIEWING.mdonmaincarries the rulings recorded on Japanese terminology and house style: rulings before the glossary merges action-translation#337 in its house-style table.