Reported in the discussion on #264.
Unlike the other US/UK examples (e.g. us_budgetary_impact.py uses ensure_datasets() to download from HuggingFace on first run), examples/income_distribution_us.py only checks for a local file at examples/data/enhanced_cps_2024_year_{year}.h5 and raises:
FileNotFoundError: Dataset not found at <path>. Run create_datasets() from policyengine.tax_benefit_models.us first.
(See examples/income_distribution_us.py:29-35.)
This is inconsistent with the rest of the example suite and is a stumbling block for new users (and JOSS reviewers).
Fix: replace load_representative_data() with the same ensure_datasets(...) pattern used in us_budgetary_impact.py so the dataset is fetched on first run.
Reported in the discussion on #264.
Unlike the other US/UK examples (e.g.
us_budgetary_impact.pyusesensure_datasets()to download from HuggingFace on first run),examples/income_distribution_us.pyonly checks for a local file atexamples/data/enhanced_cps_2024_year_{year}.h5and raises:(See
examples/income_distribution_us.py:29-35.)This is inconsistent with the rest of the example suite and is a stumbling block for new users (and JOSS reviewers).
Fix: replace
load_representative_data()with the sameensure_datasets(...)pattern used inus_budgetary_impact.pyso the dataset is fetched on first run.