Skip to content

Read life-expectancy and usa-gini from data-lectures - #834

Merged
mmcky merged 1 commit into
mainfrom
datasets/track-a-remainder
Aug 12, 2026
Merged

Read life-expectancy and usa-gini from data-lectures#834
mmcky merged 1 commit into
mainfrom
datasets/track-a-remainder

Conversation

@mmcky

@mmcky mmcky commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Wave A4 of the datasets migration. The last two Track A CSVs moved to QuantEcon/data-lectures in QuantEcon/data-lectures#74, which is merged and serving both files. Three URLs.

All three land on raw.githubusercontent.com — one spelling for reads and {download} roles alike, matching the decision taken during the high_dim_data fold. It drops a redirect hop and avoids the two-hosts-in-one-file split that the "harmonise these forms" class of fix has broken before. This does differ from the older github.com/…/raw/ form used by earlier repoint sets; harmonising those is a separate sweep, deliberately not this PR.

Left alone on purpose

simple_linear_regression.mdcols = ['Code', 'Year', 'Life expectancy at birth (historical)', 'GDP per capita']. The migrated bytes are byte-identical to intro's, so the old column label is still the correct one. Upstream OWID has since renamed four of eight columns, moved the annotations column, and halved the row count; that delta is recorded in the new manifest and registered on QuantEcon/data-lectures#39. Adopting it would change every life-expectancy value while leaving the 2018 scatter looking identical — a content change with re-reviewed figures, not a repoint.

inequality.md — the [This notebook] link to intro's _static/lecture_specific/inequality/data.ipynb. It points at a notebook, not a dataset, and that notebook stays in lecture-python-intro.

Verification

Line numbers re-derived immediately before editing, not carried from a table. Both targets serve HTTP 200 with access-control-allow-origin: *, and their sha256 match the manifests exactly (ec5d3235…, bed9074a…).

Old and new URLs produce identical frames under the lecture's own code — stronger than checking the URL returns 200:

Read Old → New
read_csv(data_url, nrows=10) (10, 8) vs (10, 8), equals: True
read_csv(data_url, usecols=cols) (62156, 4) vs (62156, 4), equals: True
…then .dropna() 12,445 vs 12,445 — which is what the prose asserts
…then Year == 2018 (the fitted scatter) 166 vs 166 rows, equals: True
read_csv(data_url, index_col='year') (20, 3) vs (20, 3), identical index

So this provably cannot change a figure.

Also checked: the commit carries both the added and removed URL lines in each file (a scripted repoint has silently shipped deletions-without-URL-change before), and no reference to intro's copies of either file remains.

This repo keeps its committed copies

Deleting them is phase 2 and is gated on more than this merge. publish.yml here fires on a publish* tag, so merging does not refresh the published notebooks — and lecture-intro.zh-cn and test-actions-lecture-intro are tag-gated too. Their published sites currently reference these exact paths. Deleting before all of those republish is precisely what QuantEcon/workspace-lectures#28 recorded.

CI here is the real check for this set: intro executes both lectures, so a dead URL raises CellExecutionError. (Its main has required_status_checks with empty contexts, so that red is loud but not a merge gate.)

Merge together with

QuantEcon/lecture-wasm and QuantEcon/test-actions-lecture-intro, same branch name. Repoint rule 2 — the strict audit has no green state for a partially-repointed dataset, and merging one half while the other sits open reproduces the 2026-08-06 failure. QuantEcon/lecture-intro.zh-cn#294 is already merged ahead of this, so the sync PR this generates should be a no-op on the repointed lines. Hand-diff that sync PR anyway.

Tracking: QuantEcon/workspace-lectures#23

Wave A4 of the datasets migration: the last two Track A CSVs moved to
QuantEcon/data-lectures in QuantEcon/data-lectures#74, which is on `main` and
serving both files. Three URLs.

All three land on `raw.githubusercontent.com` — one spelling for reads and
downloads alike, matching the decision taken during the high_dim_data fold. It
drops a redirect hop and avoids the two-hosts-in-one-file split that the
"harmonise these forms" class of fix has broken before. Note this differs from
the older `github.com/.../raw/` form used by earlier repoint sets in this repo;
harmonising those is a separate sweep, not this PR.

Left alone on purpose:

  simple_linear_regression.md  `cols = [... 'Life expectancy at birth
    (historical)' ...]`. The migrated bytes are byte-identical to intro's, so
    the old column label is still correct. Upstream OWID has since renamed four
    of eight columns and halved the row count; that delta is recorded in the
    new manifest and registered on QuantEcon/data-lectures#39. Adopting it is a
    content change, not a repoint.

  inequality.md  the `[This notebook]` link to intro's
    `_static/.../data.ipynb`. It points at a notebook, not a dataset, and that
    notebook stays in lecture-python-intro.

Verified rather than assumed. Line numbers re-derived immediately before
editing. Both targets serve 200 with `access-control-allow-origin: *` and
sha256 matching the manifests (ec5d3235… / bed9074a…). Old and new URLs produce
IDENTICAL frames under the lecture's own code: both read_csv calls in
simple_linear_regression (10x8 and 62156x4), `.dropna()` at 12,445 rows — which
is what the prose asserts — the `Year == 2018` filter at 166 rows that drives
the fitted scatter, and inequality's 20x3 with an identical index. So this
cannot change a figure.

Intro KEEPS both committed copies. Deleting them is phase 2 and is gated on
this repo publishing AND on lecture-intro.zh-cn and test-actions-lecture-intro
republishing — merging a repoint changes main, not a tag-gated published site.
That gap is what QuantEcon/workspace-lectures#28 recorded.
Copilot AI lite review requested due to automatic review settings August 12, 2026 00:31
@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for taupe-gaufre-c4e660 ready!

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

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 remaining Track A datasets referenced in the lecture notebooks to their new canonical location in QuantEcon/data-lectures, aligning these reads with the migration approach used in earlier repointing work (direct raw.githubusercontent.com URLs).

Changes:

  • Update the life-expectancy vs GDP-per-capita CSV URL used in simple_linear_regression (both the {download} link and the code cell data_url).
  • Update the USA gini/wealth/income CSV URL used in inequality (data_url in the relevant code cell).

Reviewed changes

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

File Description
lectures/simple_linear_regression.md Repoints life expectancy dataset link and in-notebook read_csv URL to QuantEcon/data-lectures via raw.githubusercontent.com.
lectures/inequality.md Repoints the USA gini dataset read_csv URL to QuantEcon/data-lectures via raw.githubusercontent.com.

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

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 12, 2026 00:40 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 12, 2026 00:41 Inactive
@mmcky
mmcky merged commit a09db42 into main Aug 12, 2026
9 checks passed
@mmcky
mmcky deleted the datasets/track-a-remainder branch August 12, 2026 00:42
@mmcky

mmcky commented Aug 12, 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#295
Files synced (2):

  • lectures/inequality.md
  • lectures/simple_linear_regression.md

mmcky added a commit to QuantEcon/data-lectures that referenced this pull request Aug 12, 2026
All four consumers now read
raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/, so the two A4
records move landed -> repointed and both manifests gain their consumers.

THIS PR IS THE WAVE'S ACCEPTANCE TEST, not bookkeeping after it. Run locally in
both directions against the four now-merged consumer repos, before pushing:

  status: landed     -> exit 1, 2 warnings ("marked landed but some consumer
                        already reads data-lectures")
  status: repointed  -> exit 0, 0 warnings

So the red window was real, opened when the first consuming PR merged, and this
closes it. A non-zero strict audit also skips the Pages deploy, and Pages serves
lectures/ as well as the dashboard, so the served data tree would have gone
stale alongside it.

Repoints recorded: QuantEcon/lecture-python-intro#834, QuantEcon/lecture-wasm#61,
QuantEcon/lecture-intro.zh-cn#294, QuantEcon/test-actions-lecture-intro#56.

All four consumers are recorded per manifest, not the two the scan can see —
the convention set by the P3 fold. lecture-intro.zh-cn and
test-actions-lecture-intro are outside SCAN_REPOS, so migration.yml and the
manifests are the only place they exist. Safe because build_audit derives its
own consumer list from the scan and never asserts on the manifest's; the
audit's own count for these two files stays 2.

The generated lecture-python-intro.notebooks mirror is a FIFTH reference-holder
and is deliberately not listed: nobody repoints it, and it self-heals after
intro's next publish tag. Recorded as a comment in both manifests so the
omission reads as a decision rather than an oversight.

Post-flip figures: migrated 24 -> 26, committed_files 43 -> 41 (lecture-wasm
deleted its two mirror-orphans in its repoint PR), orphans unchanged at 26,
CATALOG.md "26 read by lectures today" with no awaiting-repoint remainder.

consumed-file-check: 26 manifests, 27 files hash-checked, 0 errors. Catalog
freshness gate green.

WHAT THIS DOES NOT DO: nothing is deleted. lecture-python-intro still holds the
only live copy of both files, and deleting them is gated on FOUR publishes —
intro, lecture-intro.zh-cn and the canary are all tag-gated, and merging a
repoint changes main, not a published site. lecture-wasm self-heals on merge.
Track A's third item, graph.txt, is untouched and is not a data-lectures
migration at all.
mmcky added a commit that referenced this pull request Aug 12, 2026
)

Phase 2 of wave A4. #834 repointed the reads and
kept the files; this removes them, now that nothing anywhere reads them.

  lectures/_static/lecture_specific/simple_linear_regression/
      life-expectancy-vs-gdp-per-capita.csv      (2,059,709 B)
  lectures/_static/lecture_specific/inequality/
      usa-gini-nwealth-tincome-lincome.csv       (1,268 B)

Both now live at raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/,
byte-identical (sha256 ec5d3235… / bed9074a…) and CI-hash-checked there on every
PR. The bytes are not lost.

data.ipynb is KEPT. It is a notebook, not a dataset; inequality.md:618 links to
it as a reader-facing artifact, and that link is untouched. A frozen copy also
landed in data-lectures as the dataset's provenance record, but this is the copy
readers open. (It does not run under the pinned pandas 3 — that is #835, and
deliberately not fixed here.)

THE GATE, which is four publishes and not one. Merging a repoint changes `main`,
not a published site: intro, lecture-intro.zh-cn and the canary all publish on a
`publish*` tag. Skipping this is what QuantEcon/workspace-lectures#28 recorded,
and this time there is real deletion behind it. All four are now republished, and
every published artifact was re-fetched and grepped:

  intro.quantecon.org        slr + inequality, .html and _notebooks/*.ipynb   0
  lecture-intro.zh-cn        same four artifacts                              0
  test-actions-lecture-intro both pages -> 404 (trimmed toc; verify by 404,
                             not by content, since deploy-pages replaces the
                             whole artifact)                                  0
  lecture-wasm               /simple-linear-regression (hyphenated slug; its
                             inequality is commented out of myst.yml)         0
  lecture-python-intro.notebooks  refreshed 4s inside intro's publish run     0

ORG SWEEP, re-run at deletion time rather than carried from an earlier snapshot.
277 repos via the Trees API including all 25 archived ones — `gh search code`
does not index archived repos, which is how two `.rst` ancestors were missed in
an earlier sweep of a different file. One error, QuantEcon/quantecon-book-dp,
which is empty. No truncated trees. Path hits are only data-lectures' migrated
copies and the three remaining mirror-orphans; an authenticated tarball content
grep over the eight plausible consumers returns ZERO references to these paths,
with a positive control against the pre-repoint tree returning 3.

Left deliberately: lecture-intro.zh-cn and test-actions-lecture-intro still hold
their own byte-identical copies. Nothing reads them either, but they are outside
the audit's SCAN_REPOS so deleting them moves no dashboard number, and each adds
blast radius to a repo with no CI coverage of these files. They are Track X.
lecture-wasm's two were deleted in its own repoint PR, where the audit does see
the change.

The `_static/lecture_specific/simple_linear_regression/` directory becomes empty
and disappears; nothing references it. `_config.yml` and `_toc.yml` never named
either file.
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