Skip to content

Auto-fetch dataset in income_distribution_us example#332

Open
vahid-ahmadi wants to merge 1 commit intomainfrom
fix-income-distribution-us-autofetch
Open

Auto-fetch dataset in income_distribution_us example#332
vahid-ahmadi wants to merge 1 commit intomainfrom
fix-income-distribution-us-autofetch

Conversation

@vahid-ahmadi
Copy link
Copy Markdown

Fixes #329

Summary

  • examples/income_distribution_us.py previously required the user to run create_datasets() separately and raised FileNotFoundError if the local file was missing.
  • Replaced load_representative_data() with the ensure_datasets(...) pattern used by the other examples (e.g. us_budgetary_impact.py), so the dataset is downloaded from HuggingFace on first run and cached under ./data.

Test plan

  • python examples/income_distribution_us.py from a clean checkout downloads the dataset and runs through to the visualisation step.

🤖 Generated with Claude Code

Fixes #329

Match the pattern used by the other examples (e.g. us_budgetary_impact.py)
by calling ensure_datasets() to download and cache the enhanced CPS dataset
from HuggingFace on first run, instead of failing with FileNotFoundError
and asking the user to run create_datasets() manually.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vahid-ahmadi vahid-ahmadi requested a review from anth-volk May 6, 2026 11:07
@vahid-ahmadi vahid-ahmadi self-assigned this May 7, 2026
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.

examples/income_distribution_us.py does not auto-fetch its dataset

1 participant