Repository navigation
Repoint the hansen_singleton pair at QuantEcon/data-lectures (wave B2') - #1036
Conversation
Both lectures now read their monthly dataset from data-lectures instead of
this repo's own committed blobs. The bytes are byte-identical, verified at
the landing PR, so no figure changes.
Six edits, three per lecture — and only ONE of the three is a code read:
* the data URL, collapsed from a three-line string concatenation to a
single line. The stem line could not be patched in place: the flat
published tree has no _static/lecture_specific/<lecture>/ segment, so
editing it alone would leave the filename appended to a path that does
not exist;
* the prose link to the maintenance script, which moved repos and was
renamed — both make_data.py files collide in a flat builders/ tree, so
each took its dataset's stem;
* the same builder path named again in a docstring inside the data cell.
The last two break silently. No check in this repo or anywhere else covers
them: data-url-guard greps only for the LFS media host, and jupyter-cache
hashes code cells only, so a stale prose link cache-hits and goes green.
Deletes nothing. The _static copies and their READMEs stay until this has
published, per the repoint-publish-then-delete ordering rule.
Mirrors the wave in QuantEcon/data-lectures#82
Work plan: QuantEcon/workspace-lectures#39
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Repoints the Hansen–Singleton (1982/1983) lectures to load their CSV datasets from the centralized QuantEcon/data-lectures repository as part of the datasets migration, while updating accompanying documentation references to the new builder scripts.
Changes:
- Updated each lecture’s
DATA_URLto fetchhansen_singleton_198{2,3}_data.csvfromQuantEcon/data-lectures. - Updated the prose link and in-cell docstring references from the old in-repo
make_data.pyscripts to the renameddata-lectures/builders/hansen_singleton_198{2,3}_data.py.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lectures/hansen_singleton_1982.md | Switches dataset source + updates builder references for the 1982 lecture. |
| lectures/hansen_singleton_1983.md | Switches dataset source + updates builder references for the 1983 lecture. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The repoint left three sibling references to the data in each lecture and updated only two. The in-cell comment still called it "the vendored snapshot", which now says the opposite of what happens: vendoring means committing a copy here so the build does not fetch it, and the build now fetches it from QuantEcon/data-lectures at run time. "Fetch" rather than simply dropping the adjective — it names the network read, which is the whole reason the comment says "once". Raised by Copilot on #1036. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
📖 Netlify Preview Ready!Preview URL: https://pr-1036--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed LecturesBuild Info
|
✅ Translation sync completed (zh-cn)Target repo: QuantEcon/lecture-python.zh-cn
|
Both consumers now read this repo, so the tracker catches up with reality. status: landed -> repointed repoints: QuantEcon/lecture-python.myst#1036 QuantEcon/lecture-python.zh-cn#250 consumers: recorded in both manifests Acceptance test — strict audit, dry-run both directions against the repointed world: status: repointed -> exit 0 status: landed -> exit 1, "marked landed but some consumer already reads data-lectures", both files The second direction is the one that matters: between the myst merge and this flip the audit was RED, which is the design working. It has no green state for a partially-repointed dataset. lecture-python.zh-cn is recorded here or nowhere — it is outside the audit's SCAN_REPOS, so nothing machine-checkable will ever see those two reads. The generated lecture-python.notebooks mirror is a third reference-holder and is deliberately not listed: it self-heals after a publish tag and is not a repo anyone repoints (wave A4 precedent). Both manifests also record what the repoint had to do beyond the URL — each lecture named the BUILDER twice more, in a prose link and in a docstring inside the data cell, and neither is a code read, so neither would have failed a build had it been missed. Track B is now fully repointed. What remains is two publishes and the deletion of the _static copies, builders and READMEs from lecture-python.myst. Mirrors the wave in #82 Work plan: QuantEcon/workspace-lectures#39 Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…se 2) (#1037) Six files across two directories: both CSVs, both make_data.py, and both READMEs. All now live in QuantEcon/data-lectures, where the builders were renamed to their dataset stems and each README's content was folded into its manifest. Gate satisfied. Nothing reads these: * both lectures here repointed in #1036, merged and published * both lecture-python.zh-cn twins repointed in QuantEcon/lecture-python.zh-cn#250, merged and published * lecture-python.notebooks regenerated at 09:34:21Z and both notebooks carry the data-lectures URL * migration.yml flipped to `repointed` in QuantEcon/data-lectures#83, strict audit green Swept the org rather than the manifest. These files were created 2026-06-26 (a3e8443, #926), so only repos pushed since can reference them: 88 of the org's 277, swept by Trees API, zero unreadable. Exactly four hold any hansen_singleton path — this repo, zh-cn, data-lectures and the notebooks mirror. zh-cn's copies are its own committed blobs, not reads of these, and its lectures now read data-lectures; they are Track X orphans and are deliberately left alone. Deletes exactly six files, not the parent directories' 29 siblings. `hansen_singleton_198{2,3}/` held nothing else, tracked or untracked; 27 sibling directories under lecture_specific/ are untouched, including linear_algebra/ and linear_models/, whose PDFs are linked from the published site. NOTE: this will not stop the site serving them. Both ci.yml and publish.yml restore the weekly build-cache and build over it, and Sphinx never prunes removed _static assets — measured on this repo today, where wave B1's five deleted files were still served at 200 after a successful publish three hours later. The files stop being served after cache.yml rebuilds clean (Mon 03:00 UTC) and a publish follows, which will settle B1' and B2' together. Verify against the published URL with a never-existed control, never against main. Cause and fix: QuantEcon/workspace-lectures#41 Verification sweep: QuantEcon/workspace-lectures#40 Mirrors the wave in QuantEcon/data-lectures#82 Work plan: QuantEcon/workspace-lectures#39 Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Repoints both
hansen_singletonlectures atQuantEcon/data-lectures, completing wave B2′ of the datasets migration. Mirrors the wave landed in QuantEcon/data-lectures#82. Work plan: QuantEcon/workspace-lectures#39.Deletes nothing. The
_staticcopies and their READMEs stay until this has published, per the repoint → publish → delete ordering rule.No figure can change
The bytes in
data-lecturesare byte-identical to the copies these lectures read today — verified at the landing PR, and again againstmainjust now:data-lectures/raw/main/lectures/hansen_singleton_1982_data.csv3e9d4f37c31dbcab…data-lectures/raw/main/lectures/hansen_singleton_1983_data.csvdc5c1f8dac4b50ab…Both builder links resolve too (
blob/main/builders/hansen_singleton_198{2,3}_data.py, 200 each), and a never-existed control path on the same host returns 404 — so those 200s are real hits, not a soft-404 page.Six edits, and only two of them are code reads
Three per lecture. This is the part worth reviewing carefully, because two of the three break silently:
1. The data URL — collapsed, not patched. It was a three-line string concatenation:
The stem line could not be edited in place. The published tree in
data-lecturesis flat — it has no_static/lecture_specific/<lecture>/segment — so patching the stem alone would have left the filename appended to a path that does not exist. Both are now single lines on the baremainform.2. The prose link to the maintenance script. It pointed at
_static/lecture_specific/hansen_singleton_1982/make_data.pyin this repo. That builder moved repos and was renamed: both files were calledmake_data.py, which works beside their own output where the parent directory supplies the meaning, and collides outright in a flatbuilders/tree. Each took its dataset's stem.3. The same builder path, named again in a docstring inside the data cell. Easy to miss — it is not a link and not a read, just a path in prose that would have quietly become wrong.
Nothing in this repo or anywhere else would have caught edits 2 and 3.
data-url-guard.ymlgreps only for the LFS media host.jupyter-cachehashes code cells only, so a stale prose link cache-hits and goes green — which is exactly the failure class that made the D2 decision necessary in wave B1′. Both were found by grepping the filename and the URL stem separately; a line-based grep for the whole old URL returns a confident zero against the wrapped form.Verification
lecture_specific/hansen_singletonormake_data.pyin either lecture (grep exit 1, against a positive control proving the pattern matches when present); all six new references present and correct._static/.../README.mdfiles, which are scheduled for deletion in the follow-up PR along with the CSVs and builders.DATA_URLchange alters the cell hash — so CI genuinely exercises the new URL rather than restoring it from cache.What follows
lecture-python.zh-cnsync PR generates;migration.ymlflipslanded→repointedindata-lectures, recording consumers;lecture-python.myst, then merge the sync PR, then publishlecture-python.zh-cn;_staticcopies, builders and READMEs — its own PR, after the publishes.Note for step 4: deleting these files will not stop the site serving them.
ci.ymlandpublish.ymlrestore the weeklybuild-cacheartifact and build over it, and Sphinx never prunes removed_staticassets, so a deletion keeps being served untilcache.ymlrebuilds clean (Mon 03:00 UTC) and a publish follows. Verify that deletion against the published URL, never againstmain. See QuantEcon/data-lectures#81.🤖 Generated with Claude Code