Skip to content

french_rev: read the five datasets from data-lectures - #826

Merged
mmcky merged 1 commit into
mainfrom
repoint/french-rev
Aug 6, 2026
Merged

french_rev: read the five datasets from data-lectures#826
mmcky merged 1 commit into
mainfrom
repoint/french-rev

Conversation

@mmcky

@mmcky mmcky commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Repoints all five french_rev datasets 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.xlsx and fig_3.xlsx move together, since the lecture builds all three URLs from one base_url f-string. caron.npy and nom_balances.npy change 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 with lectures/ as its working directory. In the notebook a reader downloads from intro.quantecon.org, or opens in Colab, it raised FileNotFoundError. They now fetch over HTTP and load through BytesIO, which is the idiom lecture-wasm has 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:

Dataset Served sha256 vs old copy vs manifest
assignat.xlsx 200, 209,555 B identical matches
dette.xlsx 200, 632,030 B identical matches
fig_3.xlsx 200, 9,466 B identical matches
caron.npy 200, 1,136 B identical matches
nom_balances.npy 200, 1,424 B identical matches

Both .npy files additionally load to arrays equal to the previous local np.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 with usecols/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 lags main, and deleting in this PR would 404 the downloadable notebook and its Colab link until a publish* 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

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.
Copilot AI lite review requested due to automatic review settings August 6, 2026 23:20
@netlify

netlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit 50c998f
🔍 Latest deploy log https://app.netlify.com/projects/taupe-gaufre-c4e660/deploys/6a7516ca11ad130008adad96
😎 Deploy Preview https://deploy-preview-826--taupe-gaufre-c4e660.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.

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.

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_url for the three .xlsx datasets to data-lectures.
  • Replaced np.load('datasets/*.npy') with HTTP download + BytesIO + np.load(...) for the two .npy datasets.

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

Comment thread lectures/french_rev.md
@mmcky

mmcky commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Read-level equivalence, since CI cannot run

GitHub Actions is in a major outage (incident opened 2026-08-06 15:22Z, still investigating), so ci.yml has not run on this branch and the netlify preview that reports SUCCESS serves a 404 at its root — neither is evidence the lecture builds. Verifying the change directly instead.

All ten read_excel calls in the lecture were executed twice — once against this repo's existing lectures/datasets/ copy, once against the bytes served by data-lectures — with the exact arguments the lecture uses. Every pair is DataFrame.equals:

Frame Workbook Shape Identical
data2 dette.xlsx (102, 12)
data4 dette.xlsx (105, 1)
data1 dette.xlsx (99, 2)
data1a dette.xlsx (15, 1)
data5 dette.xlsx (120, 1)
data1 fig_3.xlsx (30, 4)
data11 assignat.xlsx (52, 2)
data12 assignat.xlsx (75, 1)
data7 assignat.xlsx (80, 2)
data7a assignat.xlsx (80, 1)

This is the check that matters for these three workbooks: every read is positional (header=None with usecols/skiprows/nrows), so they are positional_reads: true in their manifests and a shifted row or column would silently change a figure rather than raise.

The two .npy files were also carried through to the derived series the lecture plots — infl (63,) and bal (63,) — both identical to what the previous local np.load produced.

Run under pandas 3.0.5 / numpy 2.5.1, matching the anaconda=2026.07 pin.

This does not replace the build. It shows the data reads are equivalent; it does not exercise the notebook execution path, -nW strictness, or figure rendering. Worth letting ci.yml run before merging once Actions recovers.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 6, 2026 23:43 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 6, 2026 23:45 Inactive
@mmcky
mmcky merged commit 6986e35 into main Aug 6, 2026
8 checks passed
@mmcky
mmcky deleted the repoint/french-rev branch August 6, 2026 23:46
@mmcky

mmcky commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (zh-cn)

Target repo: QuantEcon/lecture-intro.zh-cn
Translation PR: QuantEcon/lecture-intro.zh-cn#288
Files synced (1):

  • lectures/french_rev.md

mmcky added a commit to QuantEcon/lecture-wasm that referenced this pull request Aug 6, 2026
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.
mmcky added a commit to QuantEcon/data-lectures that referenced this pull request Aug 7, 2026
…#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.
mmcky added a commit that referenced this pull request Aug 7, 2026
…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.
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