french_rev: read the five datasets from data-lectures - #826
Conversation
Repoints all five french_rev datasets onto QuantEcon/data-lectures:
assignat.xlsx, dette.xlsx and fig_3.xlsx via the base_url f-string, and
caron.npy and nom_balances.npy, which were local-path reads.
The two .npy reads are the substantive fix. `np.load('datasets/caron.npy')`
resolves only when the working directory happens to be `lectures/`, so the
downloaded notebook raised FileNotFoundError in Colab and anywhere else a
reader ran it. They now fetch over HTTP and load through BytesIO, matching
the idiom lecture-wasm already uses. These were the last local-path data
reads in this repo.
The three markdown links under "Data Sources" are repointed too. They are
prose, so no build checks them, and they would have 404'd once this repo's
copies are deleted.
Verified: all five served from data-lectures are byte-identical (sha256) to
the copies this lecture read before, and to each dataset's manifest; both
.npy files load to identical arrays, shape and dtype.
This repo's copies under lectures/datasets/ are deliberately kept in this PR
and deleted in a follow-up once the site is published, per repoint rule 3 —
the published notebook lags main and would 404 in the gap.
Part of QuantEcon/workspace-lectures#23. Data: QuantEcon/data-lectures#49.
✅ Deploy Preview for taupe-gaufre-c4e660 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Repoints the french_rev lecture’s five datasets to QuantEcon/data-lectures, and replaces the remaining local-path .npy reads with HTTP fetch + in-memory loading to work reliably on published notebooks/Colab.
Changes:
- Updated Data Sources links to point at
QuantEcon/data-lectures. - Switched the shared
base_urlfor the three.xlsxdatasets todata-lectures. - Replaced
np.load('datasets/*.npy')with HTTP download +BytesIO+np.load(...)for the two.npydatasets.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Read-level equivalence, since CI cannot runGitHub Actions is in a major outage (incident opened 2026-08-06 15:22Z, still investigating), so All ten
This is the check that matters for these three workbooks: every read is positional ( The two Run under pandas 3.0.5 / numpy 2.5.1, matching the This does not replace the build. It shows the data reads are equivalent; it does not exercise the notebook execution path, |
✅ Translation sync completed (zh-cn)Target repo: QuantEcon/lecture-intro.zh-cn
|
Repoints french_rev off lecture-python-intro's committed copies and onto QuantEcon/data-lectures, and deletes this repo's unused mirror copies. The URL form stays raw.githubusercontent.com, per repoint rule 5 — this site executes its code cells in the reader's browser, and the github.com/*/raw/ form is a 302 whose response carries an empty access-control-allow-origin. Only base_url's org, repo and path change. Verified: all five files return 200 with access-control-allow-origin: * on this host, serving bytes identical to the copies the lecture read before. The six deleted files under lectures/datasets/ were mirror-orphans — nothing in this repo read them, since french_rev has always fetched intro's copies by URL. fig_3.ods is included: it is a format twin of fig_3.xlsx that nothing anywhere references, and data-lectures dropped it for that reason. The two remaining files in that directory belong to another lecture. The three markdown links under "Data Sources" are repointed as well. They pointed into lecture-python-intro and no build checks them, so they would have 404'd silently once intro deletes its copies. Pairs with QuantEcon/lecture-python-intro#826 — both must land together, per repoint rule 2. Part of QuantEcon/workspace-lectures#23. Data: QuantEcon/data-lectures#49.
…#49) Flips assignat.xlsx, dette.xlsx, fig_3.xlsx, caron.npy and nom_balances.npy from landed to repointed, and fills in their consumers now that both lectures read them from here. migration.yml is 18 repointed, 0 landed. Hold this as a draft until QuantEcon/lecture-python-intro#826 and QuantEcon/lecture-wasm#55 have both merged. `build_audit.py` scans each consuming repo's origin/main, so while those PRs are open a strict run reports five migration_inconsistencies and exits 1 — the deliberate no-green-state window for a partially-repointed dataset (repoint rule 2). It goes green once both land; nothing else is required here. Also drops nine stale mirror-orphan annotations for lecture-wasm files that no longer exist. Six are deleted by lecture-wasm#55 in this same set; the other three (chapter_3.xlsx, longprices.xls, mpd2020.xlsx) were deleted during sets 1 and 2 and their annotations were left behind. All nine confirmed absent from that repo's working tree. check_consumed_files.py now covers 18 of 18 files, 0 errors — the five new consumer entries put these datasets under the required byte check for the first time. Part of QuantEcon/workspace-lectures#23.
…hed (#827) Phase 2 of the french_rev repoint. #826 moved the reads to data-lectures but deliberately kept these files; publish-2026aug07 has now refreshed the site, so nothing reads them any more. Verified before deleting, against the deployed artifact rather than main: the notebook served at intro.quantecon.org/_notebooks/french_rev.ipynb carries four data-lectures references, zero references to lectures/datasets/, and no local-path np.load. The wasm site's french-rev page likewise carries zero references to this repo and five raw.githubusercontent.com reads of data-lectures. An org-wide sweep over every repo's origin/main finds no remaining reader of these five paths; the only matches are data-lectures' own manifests and audit annotations. fig_3.ods stays. It is an orphan rather than part of this set, and unlike wasm's copy it is the last one in the org — data-lectures dropped it as a verified format twin of fig_3.xlsx. Retiring it is Track X's call, with the sweep that covers the other two files left in this directory. Part of QuantEcon/workspace-lectures#23. Completes the set recorded in QuantEcon/data-lectures#49.
Repoints all five
french_revdatasets onto QuantEcon/data-lectures, completing the intro static batch. Part of QuantEcon/workspace-lectures#23 (step 2); data-side record in QuantEcon/data-lectures#49.What changes
assignat.xlsx,dette.xlsxandfig_3.xlsxmove together, since the lecture builds all three URLs from onebase_urlf-string.caron.npyandnom_balances.npychange individually — and they are the substantive fix in this PR.Those two were local-path reads:
np.load('datasets/caron.npy')resolves only when the process happens to be running withlectures/as its working directory. In the notebook a reader downloads fromintro.quantecon.org, or opens in Colab, it raisedFileNotFoundError. They now fetch over HTTP and load throughBytesIO, which is the idiomlecture-wasmhas always used for these two files. These were the last local-path data reads in this repo — the failure mode P1 was created to fix.The three markdown links under Data Sources are repointed too. They are prose, so no build checks them, and they would have 404'd once this repo's copies are deleted. They are two of the references inventoried in QuantEcon/data-lectures#42.
Verification
Every file served from data-lectures was fetched and compared against the copy this lecture read before:
assignat.xlsxdette.xlsxfig_3.xlsxcaron.npynom_balances.npyBoth
.npyfiles additionally load to arrays equal to the previous localnp.load, with identical shape and dtype ((63, 2)and(81, 2),float64). All three repointed prose links return 200.Byte-identity is what makes this provably unable to change a figure: the three workbooks are
positional_reads: true, read by cell position withusecols/skiprows/nrows, so identical bytes are the only guarantee that matters.Sequencing
This repo's copies under
lectures/datasets/are deliberately kept here and deleted in a follow-up once the site is published, per repoint rule 3 — the published notebook lagsmain, and deleting in this PR would 404 the downloadable notebook and its Colab link until apublish*tag is cut.Pairs with QuantEcon/lecture-wasm#55, which must land in the same set (repoint rule 2) — wasm fetches this repo's committed blobs by URL, and data-lectures' strict audit has no green state while only one side has moved.
🤖 Generated with Claude Code