Skip to content

Read the six folded datasets from data-lectures, not high_dim_data - #60

Merged
mmcky merged 1 commit into
mainfrom
repoint/high-dim-data-fold
Aug 11, 2026
Merged

Read the six folded datasets from data-lectures, not high_dim_data#60
mmcky merged 1 commit into
mainfrom
repoint/high-dim-data-fold

Conversation

@mmcky

@mmcky mmcky commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Seven reads across four files. The six datasets moved into QuantEcon/data-lectures (QuantEcon/data-lectures#62), so every read here follows them — and the host changes too, not just the org and repo.

Why the host has to change

media.githubusercontent.com is the LFS media endpoint and routes per path by LFS status. These six were LFS-tracked in high_dim_data and are plain git in data-lectures, so the media host 404s for every one of them. Measured today:

URL
media.githubusercontent.com/media/QuantEcon/data-lectures/main/lectures/SCF_plus_mini.csv 404, 0 bytes
raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/SCF_plus_mini.csv 200, 6,118,055 B gzipped

A mechanical org/repo swap that preserved the host would have broken every chart in these three lectures. This is repoint rule 6.

Why everything lands on raw.githubusercontent.com

All four consuming repos now spell these reads identically. The set 1/2 repoints broke this repo by "harmonising" its URLs onto the github.com/…/raw/ redirect form (QuantEcon/data-lectures#46) — reasonable-looking, since the two spellings did look like an inconsistency, but that form's 302 carries an empty access-control-allow-origin, so a browser rejects it before following the redirect. One spelling on these lines means that class of fix cannot recur.

qeld (QuantEcon/data-lectures#65, tracker QuantEcon/data-lectures#66) is intended to resolve dataset URLs through one call site and make the spelling an implementation detail. The bar here is that each link works in the context it is in.

The notebook is the read nothing would carry

_static/lecture_specific/inequality/data.ipynb:37 is edited by hand. No audit scans _static/**, the build never executes it, and the translation sync is .md-only — so nothing mechanical would ever surface or carry this change. It is also a served artifact: it returns 200 on the published site with the URL in its body.

No prose is touched

The lecture says the Forbes billionaires data is a 2020 snapshot. The bytes contradict it — 2,935 rows, 282 distinct timestamps spanning 2020-04-07 to 2023-04-15, and the chart plots realTimeWorth/realTimeRank rather than the annual list's worth/rank. Split out to QuantEcon/workspace-lectures#35. The Global 2000 "2020" claim nearby is correct and is deliberately left alone.

Verification

  • Both acceptance greps clean: no media-host data-lectures read, and no high_dim_data reference anywhere in lectures/
  • All 7 URLs return 200
  • Three-way byte identity on the four cross_section files — manifest sha256 = new URL = old high_dim_data URL, so this changes the address and not the data

This repo specifically — do NOT read green CI as evidence

ci.yml here runs myst build --html with no execution, so a dead data URL is invisible to it: the pages still return 200 and the figures simply never appear, because they are produced by in-browser execution that dies at the first data cell. That is exactly how QuantEcon/data-lectures#46 went unnoticed. Green here means the markdown built, nothing more.

Verify in a browser console from a quantecon.github.io page:

fetch('https://raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/SCF_plus_mini.csv')

All seven reads here were on the media host, so raw is mandatory under rule 5, not a preference — this repo has no working alternative form. The one remaining github.com/…/raw/ reference in this repo is a {download} role in inflation_history.md, which is a plain navigation where CORS does not apply; it is correct and untouched.

The three red Netlify checks are pre-existing (lecture-wasm#49).

Part of QuantEcon/workspace-lectures#23 (step 3, PR set C2). Companion PRs land in lecture-python-intro and test-actions-lecture-intro under the same title. Merged as three independent branches off main, never stacked.

🤖 Generated with Claude Code

Seven reads across four files. The six datasets moved into
QuantEcon/data-lectures (dl#62), so every read follows them -- and the
HOST changes too, not just the org and repo.

media.githubusercontent.com is the LFS *media* endpoint and routes per
path by LFS status. These six were LFS-tracked in high_dim_data and are
plain git in data-lectures, so the media host 404s for all of them.
Measured: the media URL for data-lectures returns 404 with 0 bytes, the
raw URL returns 200. A mechanical org/repo swap preserving the host
would have broken every chart in these three lectures.

All seven land on raw.githubusercontent.com, including any that used the
github.com/*/raw/ redirect form and would have survived a bare org swap.
One spelling across all four consuming repos is deliberate: the set 1/2
repoints broke lecture-wasm by "harmonising" its URLs onto the redirect
form, whose 302 carries an empty access-control-allow-origin and so is
rejected by the browser before it is followed (dl#46). If every repo
spells these lines the same way, that class of fix cannot recur.

_static/lecture_specific/inequality/data.ipynb is edited by hand. No
audit scans _static/**, the build never executes it, and the translation
sync is .md-only -- so nothing mechanical would ever carry this change.
It is also served: it returns 200 on the published site with the URL in
its body.

No prose is touched. The lecture's claim that the Forbes billionaires
data is a 2020 snapshot is contradicted by the bytes (282 timestamps
spanning 2020-04-07 to 2023-04-15, and the chart plots realTimeWorth
rather than the annual list), but that is content, not a repoint --
split out to QuantEcon/workspace-lectures#35. The Global 2000 "2020"
claim nearby IS correct and is deliberately left alone.

Verified: both acceptance greps clean (no media-host data-lectures read,
no high_dim_data reference anywhere in lectures/); all 7 URLs return 200;
three-way byte identity on the four cross_section files -- manifest
sha256 = new URL = old high_dim_data URL, so this changes the address and
not the data.

Part of QuantEcon/workspace-lectures#23. Data: QuantEcon/data-lectures#62

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 11, 2026 04:50
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for beautiful-dodol-cb9543 failed.

Name Link
🔨 Latest commit fe465d1
🔍 Latest deploy log https://app.netlify.com/projects/beautiful-dodol-cb9543/deploys/6a7aa9fb1b3828000873376f

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

This PR updates hard-coded dataset URLs in lecture source files to point to the relocated “six folded” datasets in QuantEcon/data-lectures, using raw.githubusercontent.com so the reads work in-browser (avoiding the LFS media host and CORS/redirect pitfalls).

Changes:

  • Repoint SCF dataset reads in mle.md and inequality.md from high_dim_data (media host) to data-lectures (raw host).
  • Repoint four cross-section dataset reads in heavy_tails.md from high_dim_data (media host) to data-lectures (raw host).
  • Update the served static notebook artifact _static/lecture_specific/inequality/data.ipynb to use the new raw URL.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
lectures/mle.md Updates SCF dataset URL to raw.githubusercontent.com/QuantEcon/data-lectures/...
lectures/inequality.md Updates SCF dataset URL to raw.githubusercontent.com/QuantEcon/data-lectures/...
lectures/heavy_tails.md Updates Forbes/cities dataset URLs to raw.githubusercontent.com/QuantEcon/data-lectures/...
lectures/_static/lecture_specific/inequality/data.ipynb Updates the embedded SCF dataset URL in the notebook source

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-60--beautiful-dodol-cb9543.netlify.app (fe465d1)

✨ Browse the preview at the URL above.

@mmcky

mmcky commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Browser-fetch verification — the check this repo's CI cannot do

build-and-deploy and data-url-guard are both green, but neither is evidence that these reads work here: the build does no execution, and the guard only proves no data-lectures read sits on the media host. The failure mode this repo actually has is a URL that resolves fine for CPython and is rejected by the browser — which is how QuantEcon/data-lectures#46 shipped.

So each of the six was fetched with Origin: https://quantecon.github.io set, checking the three things Pyodide's fetch depends on:

file HTTP access-control-allow-origin redirect hops
forbes-global2000.csv 200 * 0
cities_us.csv 200 * 0
cities_brazil.csv 200 * 0
forbes-billionaires.csv 200 * 0
SCF_plus_mini.csv 200 * 0
SCF_plus_mini_no_weights.csv 200 * 0

All six browser-fetchable. The zero redirect hops matter as much as the header: the form these replaced routes through a 302 whose access-control-allow-origin is empty, so a browser rejects it before it is ever followed. That is the specific trap, and none of these six goes near it.

On the four red Netlify checks

Pre-existing and unrelated — lecture-wasm#49 documents exactly this set (Header rules, Pages changed, Redirect rules, netlify/…/deploy-preview), where the Netlify App's auto-build duplicates the workflow's own CLI preview deploy and fails while the real build is green. The real build here passed in 2m20s. This is expected to clear when the repo moves onto quantecon/actions (QuantEcon/workspace-lectures#31, QuantEcon/workspace-lectures#2).

@mmcky

mmcky commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Two corrections to my comment above, both found while validating.

The working preview is fine — the red checks are the App's separate build

There are two previews on this PR, and only one of them is failing.

The workflow's own Netlify CLI deploy (ci.yml:90-113, --alias pr-60) is the real one and it works: https://pr-60--beautiful-dodol-cb9543.netlify.app/ returns 200. The four red checks come from the Netlify GitHub App, which builds the site independently — and this repo has no netlify.toml, so the App has no build configuration to work from. Its deploy-preview alias 404s because that build never produced anything.

So the failing netlify/…/deploy-preview check is not this PR's preview. lecture-wasm#49 is the tracking issue, and it should clear when this repo moves onto quantecon/actions (QuantEcon/workspace-lectures#31, QuantEcon/workspace-lectures#2).

Only 1 of these 7 reads is in a currently-published lecture

I should have checked this before writing "verify in a browser console from a published page". In myst.yml, heavy_tails (line 68) and inequality (line 44) are commented out of the TOC — 7 of 49 lectures are disabled here, these two among them. myst.yml is untouched by this PR.

read published today?
mle.md:95 yes — serves at /mle/, and the preview shows the repointed URL with zero high_dim_data
heavy_tails.md ×4 no — lecture disabled in the TOC
inequality.md:250 no — lecture disabled in the TOC
_static/lecture_specific/inequality/data.ipynb:37 no — belongs to the disabled lecture

The repoint is still correct and still worth landing: the files are in the tree, they are what gets published the moment those entries are uncommented, and leaving them on a host that 404s would mean re-enabling the lecture silently ships broken data cells. But the live exposure of this PR is one read, not seven — so the heavy_tails/ and inequality/ 404s on the preview are expected and are not a regression.

The CORS table in my previous comment stands on its own: it tested the six URLs directly rather than through the site, so it is unaffected by which lectures are enabled.

@mmcky
mmcky merged commit d0cdff3 into main Aug 11, 2026
3 of 7 checks passed
@mmcky
mmcky deleted the repoint/high-dim-data-fold branch August 11, 2026 05:04
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