Skip to content

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

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

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, no other change.

Line What
simple_linear_regression.md:421 {download} target
simple_linear_regression.md:426 data_url
inequality.md:608 data_url

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.

Why this merges before the English repoint

Deliberate, and it is the same ordering the high_dim_data fold used. The sync PR that lecture-python-intro's merge generates will find these lines already correct, so it is a no-op on them rather than a race. When that sync PR arrives, hand-diff it against these three lines and against :443 and :605 below — do not merge it on green. The # i18n convention is prompt-level only and would not help here anyway: the cells this touches carry no CJK, and line 421 is markdown prose where the marker has no defined meaning.

Left alone on purpose

simple_linear_regression.md:443cols = ['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 and halved the row count; that delta is recorded in the new manifest and registered on QuantEcon/data-lectures#39. Adopting it would be a content change with re-reviewed figures, not a repoint.

inequality.md:605 — the [此笔记本] 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 against main immediately before editing, not carried from any table. They drift here — these three moved twice in one afternoon during the previous wave. Note bin/zh-fold-lines is hardcoded to heavy_tails / mle / inequality and cannot see simple_linear_regression.md, so that file was grepped by hand.

The localisation is intact, checked programmatically rather than by eye: both changed lines are byte-identical outside the URL itself. Line 421 is Chinese prose wrapping the {download} role — exactly the shape a whole-cell sync replacement has clobbered before. Line counts are unchanged (587 / 1102), so nothing reflowed, and no reference to intro's copies of either file remains anywhere in lectures/.

Old and new URLs produce identical frames under the lecture's own code — this is the check that matters, and it is stronger than "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 at :465 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 the repoint provably cannot change a figure.

Both targets serve HTTP 200 with access-control-allow-origin: *, and their sha256 match the manifests exactly (ec5d3235…, bed9074a…).

Note for whoever handles the deletion

Nothing is deleted anywhere by this PR. Intro still holds the only live copy of both files, and its copies must not be deleted until this repo has been republished — merging this changes main, not the published site, which is tag-gated. That gap is what QuantEcon/workspace-lectures#28 recorded. 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, no other change.

  simple_linear_regression.md:421  {download} target
  simple_linear_regression.md:426  data_url
  inequality.md:608                data_url

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.

This lands BEFORE the English repoint deliberately. The sync PR that
QuantEcon/lecture-python-intro's merge will generate then finds these lines
already correct, so it is a no-op on them instead of a race — the same
ordering used for the high_dim_data fold, where it worked.

Left alone on purpose:

  simple_linear_regression.md:443  `cols = [... 'Life expectancy at birth
    (historical)' ...]`. 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 and halved the row count; that delta is
    recorded in the manifest and registered on QuantEcon/data-lectures#39, and
    adopting it would be a content change, not a repoint.

  inequality.md:605  the `[此笔记本]` 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 against `main` immediately before editing. They
    drift here: these three moved twice in one afternoon during the previous
    wave. `bin/zh-fold-lines` cannot see simple_linear_regression.md, so that
    file was grepped by hand.
  - The localisation is intact. Both changed lines are byte-identical outside
    the URL itself, checked programmatically — line 421 is Chinese prose
    wrapping the {download} role, exactly the shape a whole-cell sync
    replacement has clobbered before.
  - Line counts unchanged (587 / 1102), so nothing reflowed.
  - No reference to intro's copies of either file remains.
  - 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.
Copilot AI lite review requested due to automatic review settings August 12, 2026 00:28
@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for playful-platypus-17d3bb ready!

Name Link
🔨 Latest commit dd0c488
🔍 Latest deploy log https://app.netlify.com/projects/playful-platypus-17d3bb/deploys/6a7bbe2d1fe2ed0008001868
😎 Deploy Preview https://deploy-preview-294--playful-platypus-17d3bb.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 final two Track A datasets (life expectancy and US gini/wealth/income) to their new canonical location in QuantEcon/data-lectures, ensuring both the {download} link and in-lecture data_url reads use the same raw.githubusercontent.com form.

Changes:

  • Update the {download} target in simple_linear_regression.md to raw.githubusercontent.com/QuantEcon/data-lectures/....
  • Update data_url in simple_linear_regression.md to the new data-lectures raw URL.
  • Update data_url in inequality.md to the new data-lectures raw URL.

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 the life expectancy CSV download link and data_url to QuantEcon/data-lectures via raw.githubusercontent.com.
lectures/inequality.md Repoints the US gini/wealth/income CSV data_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

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 12, 2026 00:35 Inactive
@mmcky
mmcky merged commit f5b43ea into main Aug 12, 2026
9 checks passed
@mmcky
mmcky deleted the datasets/track-a-remainder branch August 12, 2026 00:41
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.
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