Skip to content

FIX: add missing prob_dist data assets (unbreaks prob_dist on main) - #269

Merged
mmcky merged 1 commit into
mainfrom
fix/prob-dist-missing-data-assets
Jul 20, 2026
Merged

mmcky merged 1 commit into
mainfrom
fix/prob-dist-missing-data-assets

Conversation

@mmcky

@mmcky mmcky commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

prob_dist is currently broken on the live site, and this unbreaks it.

What's wrong

The resync of prob_dist.md in #256 brought across upstream's local data-loading code, but not the two companion data files that code reads. The whole directory is absent from this edition:

  • lectures/_static/lecture_specific/prob_dist/us_adult_heights.csv
  • lectures/_static/lecture_specific/prob_dist/japan_population_by_age.xlsx

So the lecture fails to execute on main with:

FileNotFoundError: [Errno 2] No such file or directory: '_static/lecture_specific/prob_dist/us_adult_heights.csv'

The CSV is read first, so it fails there — the .xlsx would fail immediately after. Both are added here.

Why it went unnoticed

main has had no cold build since 2026-07-16, which predates the resync merges. The break surfaced on #268's CI, an unrelated translation-sync PR that simply happened to be the next thing to trigger a build.

The edition's ci.yml also lacks -n -W on its sphinx-tojupyter step, so notebook execution errors do not fail that step — the same gap tracked fleet-wide in QuantEcon/meta#340. See the note at the bottom.

The fix

Both files copied byte-identical from the English source lecture-python-intro (sha256 verified against upstream). No other change.

I swept every _static/ asset path referenced across all of this edition's lectures and compared the lecture_specific/ directory listing against upstream — these two are the only missing assets, and prob_dist is the only missing directory. So this is complete, not a first instance.

Root cause

This is the shared/companion asset gap tracked in QuantEcon/action-translation#117. That issue was filed for quant-econ.bib, but this widens it usefully: the real class is any non-markdown file a resynced body newly depends on, including per-lecture data files, not just shared assets. Worth reflecting in the issue's scope.

Related

Unblocks #268, whose CI is currently red for this reason and not for anything in its own diff.

Two follow-ups worth considering separately, neither in this PR:

The -n -W alignment on this repo's ci.yml — the equivalent was just done for lecture-python.zh-cn in QuantEcon/lecture-python.zh-cn#185, and note the finding recorded there: adding the flag alone is insufficient, because shell: bash -l {0} gets no -e and the trailing mkdir/cp mask the build's exit code. set -eo pipefail is needed alongside it.

And a cold Build Cache dispatch on main after this merges, to confirm nothing else is broken — that is what surfaced the equivalent problems in the other edition.

🤖 Generated with Claude Code

The resync of `prob_dist.md` in #256 brought across upstream's local
data-loading code, but not the two companion data files it reads:

  lectures/_static/lecture_specific/prob_dist/us_adult_heights.csv
  lectures/_static/lecture_specific/prob_dist/japan_population_by_age.xlsx

The lecture therefore fails to execute on main with

  FileNotFoundError: '_static/lecture_specific/prob_dist/us_adult_heights.csv'

Both files are copied byte-identical from the English source. A sweep of
every `_static/` asset path referenced across the edition's lectures found
these two as the only missing assets.

This is an instance of the shared/companion asset gap tracked in
QuantEcon/action-translation#117 — the resync syncs a lecture's body but
not the non-markdown files that body newly depends on.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 20, 2026 05:21

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.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploy Preview for playful-platypus-17d3bb ready!

Name Link
🔨 Latest commit e81dbf9
🔍 Latest deploy log https://app.netlify.com/projects/playful-platypus-17d3bb/deploys/6a5db071fc4ba0000814df5c
😎 Deploy Preview https://deploy-preview-269--playful-platypus-17d3bb.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 b056185 into main Jul 20, 2026
7 checks passed
@mmcky
mmcky deleted the fix/prob-dist-missing-data-assets branch July 20, 2026 05:29
@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 20, 2026 05:34 Inactive
mmcky added a commit that referenced this pull request Jul 20, 2026
…#270)

Ports QuantEcon/lecture-python.zh-cn#185 to this edition, closing the
QuantEcon/meta#340 gap here.

ci.yml
- `-n -W --keep-going` on the sphinx-tojupyter build. It previously ran
  with no flags, so a notebook whose cells raised still exited zero.
- `set -eo pipefail` in that same block. The flag alone is insufficient:
  `shell: bash -l {0}` is a custom shell spec, so GitHub injects no
  `-eo pipefail`, and the trailing mkdir/cp become the step's exit code.
  `--keep-going` makes it worse, guaranteeing the .ipynb files exist for
  `cp` to succeed on. Found by Copilot review on zh-cn#185.
- Upload Execution Reports (Download Notebooks), so a failure in that
  step leaves a traceback artifact.
- Clear stale Sphinx environment before the builds.
- HTML artifact renamed execution-reports -> execution-reports-html.
  Required, not cosmetic: upload-artifact runs with `overwrite: false`,
  so a second upload under the same name would collide when both steps
  fail in one run.

cache.yml
- `-W --keep-going` -> `-n -W --keep-going`, so the weekly cold build is
  strict on missing references as well as warnings, matching
  lecture-python.zh-cn.

ci-cn.yml is deliberately unchanged: it has no sphinx-tojupyter step and
its HTML build is a single command, so its exit code is already the
build's. That is why it — and not ci.yml — caught the prob_dist break
in #269.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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