Skip to content

Proposal: a single canonical QuantEcon datasets repository, with a documented convention #336

Description

@jstac

Floating this for discussion. If there's rough agreement it should graduate to a QEP

Summary

Lecture data is currently hosted and referenced in at least four inconsistent ways across our lectures, with no guidance in the manual.

This causes frictions — see below.

I propose we adopt one canonical, general-purpose data repository, referenced by stable URLs, and document the convention in the manual.

Concretely: repurpose/rename QuantEcon/high_dim_dataQuantEcon/datasets rather than start a second repo.

Motivation

1. New-data files can't build on a branch (today's trigger).

While adding a population-by-age figure to prob_dist.md, the cell read the .xlsx via a https://github.com/QuantEcon/lecture-python-intro/raw/main/… URL — the pattern used by long_run_growth.md etc. Because the file was new and not yet on main, the local/PR build 404s and fails under CI's -nW. The only ways through are a two-step merge (land the data in one PR, then reference it in a second) or temporarily swapping the URL to a local path for the build. Both are fiddly and undocumented, and every contributor rediscovers this.

2. Four+ inconsistent data-hosting patterns, no rule. In lecture-python-intro alone:

  • raw/main URL from lectures/datasets/mpd2020.xlsx, longprices.xls, chapter_3.xlsx
  • raw/main URL from lectures/_static/lecture_specific/ — inequality Gini CSV, simple_linear_regression
  • relative local path, no URL — msy_fishery.md: pd.read_csv('datasets/lingcod_msy_recovery.csv')
  • external repo high_dim_data via two different hosts — plain raw.githubusercontent.com and media.githubusercontent.com (LFS)

There is no documented rule for which to use, so the choice is made ad hoc per lecture.

3. A lecture pinned to a data branch. mle.md reads from
…/high_dim_data/update_scf_noweights/SCF_plus/… — a feature branch, not main. If that branch is ever deleted or rebased, the lecture silently breaks. (Worth fixing regardless of this proposal.)

4. The data repo is mis-scoped. high_dim_data's README says "Data files for High Dimensional Economics." But its actual consumers are the intro lectures inequality, heavy_tails, mle (SCF wealth data, Forbes 2000/billionaires, US/Brazil city populations). It is already our de-facto general empirical-data repo — just misnamed, with a stale README.

5. Binary data bloats lecture repos. Committing .xlsx/.csv into the lecture repos (and into _static/) mixes binaries with narrative source. A dedicated data repo keeps lecture repos lean and text-focused.

6. No manual guidance. The style guide has zero coverage of data handling — the root cause of the inconsistency above.

7. Cross-series reuse. The same datasets (Maddison, SCF, …) are candidates for reuse across intro / programming / advanced / jax / julia. A shared data repo enables reuse instead of per-repo copies.

8. Colab / download self-containment. Relative paths break when a notebook is downloaded or opened in Colab; a stable external URL keeps notebooks self-contained. This is the legitimate reason to prefer URLs — and a dedicated data repo makes those URLs always resolvable regardless of the lecture branch, which is exactly what removes motivation #1.

Proposal

Adopt a single, dedicated, general-purpose data repository as the canonical home for lecture datasets, referenced by stable URLs, with the convention documented in the manual. Specifically, repurpose high_dim_data into QuantEcon/datasets, rather than create a second general repo — two general-purpose data repos would reintroduce the "which repo?" confusion.

Key design points:

  • LFS is per-path (.gitattributes): large binaries tracked via LFS, small teaching files stay plain git in the same repo.
  • Make it flat (just dump files) or organize by topic subfolders (demography/, inequality/, cross_section/, SCF_plus/, …).
  • One documented URL form and a decision on main-vs-tag pinning (see open questions).

Alternatives considered

  • Status quo (raw/main same-repo + two-step merges): ongoing friction, permanent per-lecture inconsistency.
  • Relative local paths everywhere (the msy_fishery pattern): simplest single-PR build, but breaks Colab/download self-containment and still bloats lecture repos.
  • Two repos split by "high-dim vs low-dim": the size boundary is fuzzy and technically unnecessary (LFS is per-path); the split is what causes confusion.
  • New datasets repo alongside high_dim_data: two parallel general repos → "which repo?" ambiguity. Since high_dim_data isn't really book-specific, repurposing it is cleaner.

Rollout

  • Confirm no external "High Dimensional Economics" project still depends on high_dim_data (nothing in the lecture series does — only intro's 3 files).
  • Rename QuantEcon/high_dim_dataQuantEcon/datasets. GitHub redirects preserve existing URLs, so this is non-breaking; the sweep below can follow at leisure.
  • Rewrite the README to state the real, general purpose.
  • Set .gitattributes for per-path LFS (large binaries LFS; small teaching files plain git).
  • Decide the layout (flat, or topic subfolders) and organize accordingly.
  • Standardize the URL form and pinning policy (open question below).
  • Sweep existing references to the new name (3 files in intro: inequality, heavy_tails, mle) and fix the mle.md branch-pin → main.
  • Document in the manual — new styleguide/datasets.md: the routing rule ("data owned by a specific book/project → that repo; otherwise → datasets"), LFS-per-path, the URL form, and the pinning policy.
  • Going forward: new lecture data → PR to datasets → reference by stable URL. A single lecture PR then builds green immediately.

Smaller issues to open regardless of the outcome

  1. mle.md pins a data branch (update_scf_noweights) instead of main — latent breakage. (bug)
  2. high_dim_data uses two URL hosts (raw vs media/LFS) for files in the same repo — standardize.

Open questions for the team

  1. Repo namedatasets? data? Something else?
  2. Layout — flat or by topic
  3. Pinning — reference main (simple, mutable) or a tag/commit SHA (reproducible builds)?
  4. URL form — settle plain raw.githubusercontent.com vs media.githubusercontent.com/LFS as a documented rule.

Recommendation on process

This touches every lecture series plus a data repo and establishes a working/tooling convention documented in the manual — per QEP-1 that is exactly what a QEP is for. Recommendation: use this issue to socialise and converge; once there's rough agreement, I'll graduate it to a QEP (type: standard) recording the datasets-repo convention, with styleguide/datasets.md as the implementation.

Context: this came out of a session adding a Japanese population age-distribution figure to prob_dist.md in lecture-python-intro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions