Repoint the ols, mle and phillips data reads to data-lectures (wave B1') - #1034
Merged
Conversation
Seven code-cell reads across three lectures, plus the prose download link in mle.md, now read QuantEcon/data-lectures instead of this repo's own committed blobs. The bytes are byte-identical — verified by sha256 in the landing PR — so no figure or coefficient changes. Reproduced from the new URL: ols.md's headline regression still gives n=111, b0=4.6261, b1=0.5319, R-squared=0.6113, the 4.63 / 0.53 / 0.611 the prose quotes. The files under lectures/_static/lecture_specific/ are deliberately NOT deleted here. This repo publishes on a `publish*` tag, so the already-published notebooks keep the old URLs until the next publish; deleting now would 404 them for every reader who opens a lecture in Colab. Deletion is a follow-up PR gated on the publish. Three details worth noting for review: * mle.md:160's prose link pointed at the published site (python.quantecon.org/_static/...), not at this repo. That URL survives a repoint and breaks only when the file is deleted and the site republishes — no automated check here would catch it, because jupyter-cache hashes code cells only, so a prose-only edit cache-hits and CI goes green. It also named `mle/fp.dta` inline, a path that does not exist in the flat published tree, so the filename in the sentence is corrected too. * phillips_drifts_volatilities.md built its URL by string concatenation across three source lines. The continuation is collapsed rather than patched: editing only the host line would have left 'NEWQDATA.csv' appended to a path that no longer exists. * The reads are normalised to the documented CPython form, github.com/QuantEcon/data-lectures/raw/main/lectures/<file>. NEWQDATA.csv previously used raw.githubusercontent.com, which is equally valid here; the uniform spelling makes the seven reads look like one change. Adds data-url-guard.yml, which this repo lacked. It is a copy of the one in lecture-python-intro with its comments corrected for this repo — intro's cites `exclude_patterns`, which this repo's _config.yml does not define. Part of QuantEcon/workspace-lectures#39. Data landed in QuantEcon/data-lectures#79. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates several lecture notebooks to read their datasets from the centralized QuantEcon/data-lectures repository (instead of this repo’s vendored _static copies) and adds a CI guard to prevent accidentally using the Git LFS “media” endpoint for data-lectures URLs.
Changes:
- Repointed multiple
pd.read_stata(...)calls inols.mdtohttps://github.com/QuantEcon/data-lectures/raw/main/lectures/.... - Updated
mle.mdto repoint both the prose download link and the code-cell data read todata-lectures. - Simplified and repointed the
data_urlconstruction inphillips_drifts_volatilities.md, and introduced a GitHub Actions guard workflow to detectmedia.githubusercontent.com/media/QuantEcon/data-lecturesusage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
lectures/ols.md |
Repoints five Stata dataset reads to QuantEcon/data-lectures raw URLs. |
lectures/mle.md |
Updates the prose download hyperlink and the code-cell Stata read to QuantEcon/data-lectures. |
lectures/phillips_drifts_volatilities.md |
Collapses multi-line URL construction and repoints the CSV URL to QuantEcon/data-lectures. |
.github/workflows/data-url-guard.yml |
Adds a PR/push guard that fails if data-lectures is referenced via the LFS media.githubusercontent.com host. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
📖 Netlify Preview Ready!Preview URL: https://pr-1034--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed LecturesBuild Info
|
Contributor
Author
✅ Translation sync completed (zh-cn)Target repo: QuantEcon/lecture-python.zh-cn
|
This was referenced Aug 13, 2026
mmcky
added a commit
that referenced
this pull request
Aug 13, 2026
…ed (#1035) Phase 2 of the repoint. These five now live in QuantEcon/data-lectures and every consumer reads them from there: lectures/_static/lecture_specific/ols/maketable1.dta lectures/_static/lecture_specific/ols/maketable2.dta lectures/_static/lecture_specific/ols/maketable4.dta lectures/_static/lecture_specific/mle/fp.dta lectures/_static/lecture_specific/phillips_drifts_volatilities/NEWQDATA.csv Deliberately split from the repoint (#1034) rather than bundled with it. This repo publishes on a `publish* tag`, so the already-published notebooks kept the old URLs until the site refreshed; deleting in the same PR would have 404'd every reader who downloaded a lecture or opened it in Colab. The gate has now been met: publish-2026aug13 shipped, python.quantecon.org serves only data-lectures URLs, and lecture-python.notebooks regenerated clean. Exactly five files, never the parent directory. `_static/lecture_specific/` has 32 subdirectories in HEAD and 29 survive. Two of the survivors would have been silent breakage: hansen_singleton_1982/ and hansen_singleton_1983/ each hold a make_data.py that is still read at runtime by both this repo and lecture-python.zh-cn (wave B2'), and linear_algebra/course_notes.pdf plus linear_models/iteration_notes.pdf are linked from the published PDF, from lecture-python.zh-cn and from tom-course-2025's Pages site. The three directories that do disappear held only the deleted files. An org-wide sweep cleared this: 277/277 repos plus 38 Pages-source branches, 51 course/workshop/canary repos individually checked, outside-org forks and GitHub-wide code search, then an adversarial pass that reproduced every control from scratch. Nothing executable breaks anywhere, in or outside the org -- every read now points either at data-lectures or at an archived QuantEcon repo holding its own byte-identical copy. The known residual is three third-party course sites whose prose download link for fp.dta will 404 (mcherculano/ECON5129, quecheny/quecheny, elliottserna/econometrics). Their notebooks keep working: their executable reads point at the archived QuantEcon/lecture-python, which this migration does not touch. Recorded rather than fixed -- QuantEcon cannot edit those repos. Not irreversible: the bytes stay in this repo's history, exist byte-identically in ten other repos, and every publish cuts a full-site release asset. Part of QuantEcon/workspace-lectures#39. Data landed in QuantEcon/data-lectures#79 and flipped in #80. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wave B1′ step 2. Seven code-cell reads across three lectures, plus the prose download link in
mle.md, now readQuantEcon/data-lecturesinstead of this repo's own committed blobs.The data landed in QuantEcon/data-lectures#79, which recorded the byte gate: all five files are byte-identical to the copies this repo serves today. So this repoint provably cannot change a figure or a coefficient — and reproduced from the new URL,
ols.md's headline regression still gives n=111, b0=4.6261, b1=0.5319, R²=0.6113, which is the 4.63 / 0.53 / 0.611 the prose quotes.The files under
lectures/_static/lecture_specific/are deliberately NOT deleted here. This repo publishes on apublish*tag, so the already-published notebooks keep the old URLs until the next publish; deleting now would 404 them for every reader who downloads a lecture or opens it in Colab, and nothing would alert us — rendered HTML is unaffected because figures are baked at build time. Deletion is a follow-up PR gated on the publish.What changed
ols.mdread_statareads →maketable1/2/4.dtamle.mdfp.dta(see below)mle.mdread_stataread →fp.dtaphillips_drifts_volatilities.mddata_urlcontinuation collapsed →NEWQDATA.csvAll reads use the documented CPython form,
https://github.com/QuantEcon/data-lectures/raw/main/lectures/<file>.Three details worth a reviewer's eye
mle.md:160pointed at the published site, not at this repo. The link washttps://python.quantecon.org/_static/lecture_specific/mle/fp.dta. That URL survives a repoint and breaks only when the file is deleted and the site republishes — a delayed 404 with no rule covering it. It also namedmle/fp.dtainline in the sentence, a path that does not exist in the flat published tree, so the filename in the prose is corrected alongside the href.Note no automated check in this repo would have caught that link.
ci.ymlexecutes the book, butjupyter-cachehashes code-cell source only and the workflow restores a warm sharedbuild-cacheartifact — so a prose-only edit cache-hits, the notebook is never executed, and CI goes green over a dead link.linkcheck.ymlwould report it, but it runs weekly, scans the published release archive rather than this branch, and isfail: false. Do not read a green CI here as evidence that a prose link resolves.phillips_drifts_volatilities.mdbuilt its URL by string concatenation across three source lines. The continuation is collapsed to a single line rather than patched in place. Patching only the host line would have left'NEWQDATA.csv'appended to a path that no longer exists — the flat published tree has no_static/lecture_specific/<lecture>/segment to append it to. This was the only form-B (raw.githubusercontent.com) read of the seven.data-url-guard.ymlis added. This repo lacked it;lecture-python-introandlecture-wasmboth have it. It greps formedia.githubusercontent.com/media/QuantEcon/data-lectures— the LFS media endpoint, which routes per path and so 404s everything data-lectures publishes, since that tree is 100% plain git. The risk is specifically a mechanical org/repo swap that preserves the host, which is exactly the shape of this PR's edits. It is a copy of intro's with its comments corrected for this repo: intro's citesexclude_patterns, which this repo's_config.ymldoes not define.Verification
(163, 13),(163, 9),(163, 10),(5432, 36),(211, 4)ols.md's headline OLS reproduced exactly from the repointed URL (above)_static/lecture_specific/{ols,mle,phillips_drifts_volatilities},lecture-python.myst/raw,raw.githubusercontent.com/QuantEcon/lecture-python.myst, orpython.quantecon.org/_static/lecture_specific/mlein the three lecturesgit diff --statis 8 insertions / 12 deletions across three.mdfiles and no file deletions — the committed data files are untouchedWhat comes next
[translation-sync]PR fires intolecture-python.zh-cn. Hand-diff it before merging — the sync replaces whole##sections through a model and will clobber localisations near the reads.QuantEcon/lecture-statscarries the identicalpython.quantecon.org/…/fp.dtaprose link atlectures/mle.md:132and runs a daily linkcheck. Its repoint is part of this wave.data-lecturesflips torepointedand records consumers.lecture-python.notebooksregenerates ~29 min after this repo's tag._staticcopies.Part of QuantEcon/workspace-lectures#39.
🤖 Generated with Claude Code