Skip to content

Read the three wave-C1 datasets from data-lectures (Track C) - #372

Merged
mmcky merged 1 commit into
mainfrom
datasets/track-c1
Aug 17, 2026
Merged

Read the three wave-C1 datasets from data-lectures (Track C)#372
mmcky merged 1 commit into
mainfrom
datasets/track-c1

Conversation

@mmcky

@mmcky mmcky commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Repoints the three wave-C1 datasets at QuantEcon/data-lectures, where they landed byte-identical in QuantEcon/data-lectures#92.

Both reads are collapsed, not patched

subjective_beliefs_business_cycles.md built its path from a shared data_path stem. Editing that line alone would have left both filenames appended to a _static/lecture_specific/<lecture>/ segment that does not exist in the flat published tree — the wave-B2′ lesson. The two bbh files share the variable and so repoint together in one edit.

hansen_jagannathan_1991.md already read over a URL, so this is a URL-string edit rather than a path→URL conversion. The old URL was split across three adjacent string literals; the new one is a single line, deliberately. A whole-URL grep returns a confident zero against the wrapped form, which is exactly how a sweep misses a live reference — this session hit that trap more than once. It is now greppable in one piece.

URL form

github.com/QuantEcon/data-lectures/raw/main/lectures/<file>, per the URL-forms table in data-lectures AGENTS.md. raw.githubusercontent.com is reserved for lecture-wasm, whose cells execute in the reader's browser and need a CORS-clean host; this repo is a CPython consumer, and wave B2′ used this form in lecture-python.myst.

The wave plan QuantEcon/workspace-lectures#45 step 2 prescribes the wasm form for this repo. That is wrong, and is noted on the plan.

Proven not to change a figure

Not "the URL returns 200" — each lecture's own loading code was run against the old location and the new URL and the results compared:

read old new .equals()
bbh_macro_quarterly.csv (260, 14) (260, 14) True — columns and index identical
bbh_michigan_monthly.csv (507, 5) (507, 5) True — columns and index identical
hansen annual (95, 4) (95, 4) True
hansen monthly (334, 3) (334, 3) True
hansen quarterly (270, 4) (270, 4) True

The hansen bundle's raw JSON is byte-identical between the two URLs.

A basename sweep with a firing positive control and a zero negative control finds each of the three names exactly once, at its repointed read, and no _static/lecture_specific/… path reference to any of them remains.

The local copies are retained

Deleting them here would 404 the already-published notebooks until someone tags a publish. The deletion is a follow-up PR after this one publishes.

That ordering matters more than usual for hansen_jagannathan_1991_data.json: it is fetched over the network at cell-execution time, so it has no stale-serving grace period at all — deleting it breaks every notebook and Colab reader the instant the blob leaves main, rather than after a cache rebuild.

Deliberately not in this PR

_load_bundle()'s local-path fallback branch is now unreachable, since DATA_URL is always a URL. Removing it is behaviour-neutral, but it does not belong in a repoint whose entire claim is that nothing changed. Worth a follow-up, along with the from pathlib import Path import it is the only user of.

🤖 Generated with Claude Code

Repoints subjective_beliefs_business_cycles.md and hansen_jagannathan_1991.md
at QuantEcon/data-lectures, where the three files landed byte-identical in
QuantEcon/data-lectures#92.

Both reads are COLLAPSED rather than patched, which is the wave-B2' lesson.
subjective_beliefs_business_cycles.md built its path from a shared
`data_path` stem, so editing that line alone would have left both filenames
appended to a `_static/lecture_specific/<lecture>/` segment that does not
exist in the flat published tree. The two bbh files share that variable and
therefore repoint together, in one edit.

hansen_jagannathan_1991.md already read over a URL, so this is a
URL-string edit rather than a path-to-URL conversion — but the old URL was
split across three adjacent string literals, and the new one is a single
line. That is deliberate: a whole-URL grep returned a confident ZERO against
the wrapped form, which is how a sweep misses a live reference. It is now
greppable in one piece.

URL form is github.com/QuantEcon/data-lectures/raw/main/lectures/<file>, per
the URL-forms table in data-lectures AGENTS.md: raw.githubusercontent.com is
reserved for lecture-wasm, whose cells execute in the reader's browser and
need a CORS-clean host. This repo is a CPython consumer, and wave B2' used
the same form in lecture-python.myst. The wave plan
QuantEcon/workspace-lectures#45 prescribes the wasm form for this repo, which
is wrong; noted there.

Proven not to change a figure, by running each lecture's own loading code
against the old location and the new URL and comparing frames:
bbh_macro_quarterly (260, 14) and bbh_michigan_monthly (507, 5) both
`.equals()` True with identical columns and index; the hansen bundle's three
tables — annual (95, 4), monthly (334, 3), quarterly (270, 4) — all
`.equals()` True, and the raw JSON is byte-identical.

The local copies are RETAINED. Deleting them here would 404 the
already-published notebooks until someone tags a publish; the deletion is a
follow-up PR after this one publishes. That ordering matters more than usual
for the hansen bundle, which is fetched over the network at cell-execution
time and so has no stale-serving grace period at all.

The dead local-path fallback branch in _load_bundle() is left alone
deliberately — it is unreachable once DATA_URL is a URL, but removing it is a
behaviour-neutral cleanup that does not belong in a repoint whose whole claim
is that nothing changed.

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

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit a0c006a
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/6a82619e0bd5ba000822bebd
😎 Deploy Preview https://deploy-preview-372--lustrous-melomakarona-3ee73e.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

This PR repoints three wave-C1 lecture datasets to be fetched from QuantEcon/data-lectures, aligning Track C lectures with the centralized published data location while keeping the in-repo copies intact for now.

Changes:

  • Update subjective_beliefs_business_cycles.md to read the two BBH CSV datasets from QuantEcon/data-lectures via a shared URL stem.
  • Update hansen_jagannathan_1991.md to fetch the Hansen-Jagannathan JSON bundle from QuantEcon/data-lectures using a single-line URL string.

Reviewed changes

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

File Description
lectures/subjective_beliefs_business_cycles.md Switch BBH CSV reads from a local _static/lecture_specific/... path to the centralized data-lectures raw URL base.
lectures/hansen_jagannathan_1991.md Replace the prior wrapped URL with a single-line data-lectures raw URL for the JSON bundle.

💡 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
Contributor

@github-actions
github-actions Bot temporarily deployed to pull request August 17, 2026 01:30 Inactive
@mmcky
mmcky merged commit a019e67 into main Aug 17, 2026
10 checks passed
@mmcky
mmcky deleted the datasets/track-c1 branch August 17, 2026 01:40
mmcky added a commit that referenced this pull request Aug 17, 2026
The lectures have read these from QuantEcon/data-lectures since #372, and
publish-2026aug17 has since shipped that repoint, so the local copies are no
longer reachable by anything.

The publish gate was verified rather than assumed, and by basename rather
than by URL. Before the publish, both published notebooks carried zero
`data-lectures` references and one `_static/lecture_specific` each; after it,
both carry `data-lectures` and zero `_static/lecture_specific`, and the
generated lecture-python-advanced.notebooks mirror matches. That ordering is
what makes this deletion safe, and it mattered most for
hansen_jagannathan_1991_data.json, which is fetched over the network at
cell-execution time: deleting it while a published notebook still named the
old URL would have broken every notebook and Colab reader instantly, with no
cache rebuild to ride out.

An org-wide sweep re-derived the consumer set at deletion time rather than
trusting the one taken when the wave was planned. All 278 QuantEcon repos
enumerated, 277 with a default branch swept over the Trees API,
authenticated so the 69 private repos are covered rather than silently 404ing.
The three filenames appear in exactly two repos: data-lectures, which is
their new home, and this one. Positive control fired (this repo's own copies
were found); negative control returned zero.

Both `_static/lecture_specific/` directories held nothing but the migrated
files, so git removes them entirely.

The published site keeps serving these paths until the next cache rebuild and
publish — every repo here restores a cached `_build/html` and Sphinx never
prunes assets removed from source. That is expected under the settle policy
agreed for this migration, not a failure of this PR: the deletion is complete
on `main`, and the site clears on the weekly cycle. Verify a deletion against
the published URL, never against `main`.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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