From a0c006ad0e7c57d2ca0766dbc6e808e1981edbf1 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Mon, 17 Aug 2026 11:18:59 +1000 Subject: [PATCH] Read the three wave-C1 datasets from data-lectures (Track C) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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//` 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/, 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) --- lectures/hansen_jagannathan_1991.md | 6 +----- lectures/subjective_beliefs_business_cycles.md | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lectures/hansen_jagannathan_1991.md b/lectures/hansen_jagannathan_1991.md index 2987f38e..ad83b154 100644 --- a/lectures/hansen_jagannathan_1991.md +++ b/lectures/hansen_jagannathan_1991.md @@ -179,11 +179,7 @@ interchangeably. import json, urllib.request -DATA_URL = ( - "https://raw.githubusercontent.com/QuantEcon/lecture-python-advanced.myst/" - "refs/heads/main/lectures/_static/lecture_specific/" - "hansen_jagannathan_1991/hansen_jagannathan_1991_data.json" -) +DATA_URL = "https://github.com/QuantEcon/data-lectures/raw/main/lectures/hansen_jagannathan_1991_data.json" def _load_bundle(url): diff --git a/lectures/subjective_beliefs_business_cycles.md b/lectures/subjective_beliefs_business_cycles.md index 0477c2fb..efac3d88 100644 --- a/lectures/subjective_beliefs_business_cycles.md +++ b/lectures/subjective_beliefs_business_cycles.md @@ -146,10 +146,10 @@ one-year-ahead inflation forecast and the shares of households answering the monthly unemployment rate. ```{code-cell} ipython3 -data_path = '_static/lecture_specific/subjective_beliefs_business_cycles/' -macro_q = pd.read_csv(data_path + 'bbh_macro_quarterly.csv', +data_url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/' +macro_q = pd.read_csv(data_url + 'bbh_macro_quarterly.csv', index_col='YYYYQ') -mich_m = pd.read_csv(data_path + 'bbh_michigan_monthly.csv', +mich_m = pd.read_csv(data_url + 'bbh_michigan_monthly.csv', index_col='yyyymm') ```