Skip to content

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

@vahid-ahmadi

Description

@vahid-ahmadi

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.

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