inflation_history: read longprices.xls and chapter_3.xlsx from data-lectures - #53
Conversation
…ectures
Repoints both spreadsheets at the canonical data repository, deletes this
repo's unused copies, and drops the last of this lecture's dependencies on
lecture-python-intro's repository layout.
THREE references move, in TWO different URL forms -- worth noting because it
is why a single find-and-replace would have missed one. The two read_excel
calls used raw.githubusercontent.com; the {download} directive at line 220
used github.com/.../raw/. Both pointed into intro's repo, and both would have
broken when intro deleted those files.
That {download} is also invisible to the data-lectures audit, which classifies
references by the code that reads them. A dead download link fails no build in
either repo, so nothing would have reported it. See
QuantEcon/data-lectures#42.
Dropping raw.githubusercontent.com is a side benefit: that form returns
pointer text rather than data for any file in Git LFS, failing as a confusing
parse error instead of a 404. The /raw/ form works either way
(QuantEcon/data-lectures AGENTS.md, "URL forms").
Bytes unchanged -- both files are byte-identical to what data-lectures serves
(git blobs 1a2e141 and a3f100e), matching the sha256 in their manifests.
The deleted copies were mirror-orphans: committed here but never read, because
the lecture fetched intro's copies instead. Doubly dead now, so they go in the
same PR rather than waiting for the orphan sweep.
Paired with the intro half; neither may land alone. See
QuantEcon/data-lectures PLAN.md, "Repoint rules".
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
❌ Deploy Preview for beautiful-dodol-cb9543 failed.
|
|
📖 Netlify Preview Ready! Preview URL: https://pr-53--beautiful-dodol-cb9543.netlify.app (0af3957) ✨ Browse the preview at the URL above. |
There was a problem hiding this comment.
Pull request overview
Repoints the inflation_history lecture’s spreadsheet sources to the canonical QuantEcon/data-lectures repository to avoid relying on lecture-python-intro’s repository layout and to use /raw/ URLs that work for Git LFS–tracked files.
Changes:
- Update
pd.read_excel/pd.ExcelFileURLs forlongprices.xlsandchapter_3.xlsxtohttps://github.com/QuantEcon/data-lectures/raw/main/lectures/.... - Update the
{download}link forchapter_3.xlsxto the new canonical location.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot caught a fourth reference this PR had missed: the narrative link introducing the spreadsheet still pointed at this series own lectures/datasets directory, which this PR empties. It would not have 404d -- the directory survives with other files -- it would have quietly become wrong, which nothing would ever flag. It now points at data-lectures CATALOG.md rather than a directory listing. A reader following "hosted on github" gets the dataset registry: source, licence, integrity status and which lectures consume each file. That is strictly more useful than the folder it replaced, and the catalog is generated from the manifests, so it cannot drift out of date. Worth recording why the earlier sweep missed this. It searched for links ENDING in a data-file extension, so a link to a DIRECTORY was invisible to it -- a blind spot in the check for the audits blind spot. Re-sweeping properly found two more of the same shape (inequality.md in both repos, linking to the usa-gini builder notebook), which belong to a later wave. Folded into QuantEcon/data-lectures#42. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
📖 Netlify Preview Ready! Preview URL: https://pr-53--beautiful-dodol-cb9543.netlify.app (4245293) ✨ Browse the preview at the URL above. |
Copilot noted the link text reads "hosted on github". Checking the corpus rather than treating it as taste: across the Python lecture family the prose convention is GitHub, with 12 uses in lecture-python-programming, 6 in lecture-python.myst and 1 here, and zero lowercase anywhere else. This line is the only lowercase instance in the family, and it appears twice because wasm mirrors intro. So it is the outlier, not a preference. Same review also flagged the link TARGET, which was already fixed in the preceding commit -- the comment was written ten minutes before that push. Only the capitalisation remained. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
📖 Netlify Preview Ready! Preview URL: https://pr-53--beautiful-dodol-cb9543.netlify.app (1d42dc2) ✨ Browse the preview at the URL above. |
Held as a draft: must not merge before QuantEcon/lecture-python-intro#824 and QuantEcon/lecture-wasm#53. Verified both ways -- against the lecture repos' current main this fails with "marked repointed but consumers still read via ['own-repo', 'sibling']" for both files; against their repoint branches it passes clean and orphans fall 34 -> 32 as wasm's two mirror copies go. Set 2 of three. Unlike set 1 this batch had a reference the audit cannot see: a {download} directive in each repo offering chapter_3.xlsx to readers, pointing at the file being deleted. The lecture PRs move those too. The general problem -- ten such prose references across the remaining migration, none visible to the scan -- is #42. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This site executes code cells in the reader's browser (Pyodide via pyodide_http), so every pandas URL read is subject to CORS on each redirect hop. The github.com/<org>/<repo>/raw/ form 302s with an empty access-control-allow-origin header and fails in the browser before the redirect is followed; raw.githubusercontent.com and (for LFS files) media.githubusercontent.com serve access-control-allow-origin: * and work. Flips the five affected reads: - long_run_growth.md, inflation_history.md: the data-lectures reads repointed in #52/#53 move to raw.githubusercontent.com - inequality.md, mle.md: the pre-existing SCF reads move to media.githubusercontent.com (the LFS host heavy_tails already uses) {download} links and prose links are plain navigations, so they keep the github.com form. All five new URLs verified fetching from this site's origin in headless Chromium with the exact expected byte counts. The regression and the repoint rule are tracked in QuantEcon/data-lectures#46. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Repoints
inflation_historyat the canonical data repository, deletes this repo's unused copies oflongprices.xlsandchapter_3.xlsx, and drops the last of this lecture's dependencies onlecture-python-intro's repository layout.Paired with QuantEcon/lecture-python-intro#824 — neither may land alone.
Three references, in two different URL forms
Worth spelling out, because it is why a single find-and-replace would have missed one:
read_excel—longprices.xlsraw.githubusercontent.com/…read_excel—chapter_3.xlsxraw.githubusercontent.com/…{download}offeringchapter_3.xlsxgithub.com/…/raw/…All three pointed into
lecture-python-intro, and all three break when it deletes those files in the paired PR.The
{download}is also invisible to the data-lectures audit, which classifies references by the code that reads them. A dead download link fails no build in either repo, so nothing would have reported it — see QuantEcon/data-lectures#42.Two side benefits
The sibling dependency goes. This lecture no longer reads files out of another repository's working layout — an invisible constraint on that repo, and one nothing would have caught until a build broke.
raw.githubusercontent.comgoes. That form returns pointer text rather than data for any file tracked in Git LFS, failing as a confusing parse error rather than a 404. The/raw/form works regardless of storage (QuantEcon/data-lecturesAGENTS.md, "URL forms").No figure moves
Both files are byte-identical to what data-lectures serves — git blobs
1a2e141anda3f100e— and the served URLs return sha256 matching the manifests, verified today.About the deleted copies
Both were mirror-orphans: committed here but never read, because the lecture fetched intro's copies instead. Doubly dead once this lands, so they go now rather than waiting for the orphan sweep — the orphan count falls alongside the migration rather than accumulating into one large cleanup.
Part of the Track A migration. See QuantEcon/data-lectures#8.