diff --git a/.github/workflows/code_changes.yaml b/.github/workflows/code_changes.yaml index e15c82a1..4b0509d9 100644 --- a/.github/workflows/code_changes.yaml +++ b/.github/workflows/code_changes.yaml @@ -38,7 +38,6 @@ jobs: with: workload_identity_provider: "projects/322898545428/locations/global/workloadIdentityPools/policyengine-research-id-pool/providers/prod-github-provider" service_account: "policyengine-research@policyengine-research.iam.gserviceaccount.com" - - name: Install package run: uv pip install -e .[dev] --system - name: Download data inputs @@ -57,4 +56,4 @@ jobs: env: HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} - name: Test documentation builds - run: make documentation \ No newline at end of file + run: make documentation diff --git a/.github/workflows/pr_code_changes.yaml b/.github/workflows/pr_code_changes.yaml index 192d2f2c..1ca8b398 100644 --- a/.github/workflows/pr_code_changes.yaml +++ b/.github/workflows/pr_code_changes.yaml @@ -9,6 +9,7 @@ on: paths: - policyengine_us_data/** - tests/** + - .github/workflows/** jobs: Lint: @@ -19,11 +20,46 @@ jobs: uses: "lgeiger/black-action@master" with: args: ". -l 79 --check" + + SmokeTestForMultipleVersions: + name: Test Minimal Install & Import (${{ matrix.os }}, py${{ matrix.python-version }}) + runs-on: ${{ matrix.os }} + needs: Lint + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ['3.11', '3.12'] + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install package ONLY (no dev deps) + run: python -m pip install . + + - name: Test basic import + run: python -c "import policyengine_us_data; print('Minimal import OK')" + + - name: Test specific core import + run: python -c "from policyengine_core.data import Dataset; print('Core import OK')" + Test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + needs: Lint + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + env: + HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} steps: - name: Checkout repo uses: actions/checkout@v2 + - name: Install uv uses: astral-sh/setup-uv@v5 @@ -31,14 +67,14 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.11' - - name: Install package run: uv pip install -e .[dev] --system + - name: Download data inputs run: make download env: HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} - POLICYENGINE_US_DATA_GITHUB_TOKEN: ${{ secrets.POLICYENGINE_US_DATA_GITHUB_TOKEN }} + - name: Build datasets run: make data env: @@ -46,5 +82,6 @@ jobs: PYTHON_LOG_LEVEL: INFO - name: Run tests run: pytest + - name: Test documentation builds - run: make documentation \ No newline at end of file + run: make documentation diff --git a/Makefile b/Makefile index e791a174..4b66bbf7 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ documentation: data: + python policyengine_us_data/utils/uprating.py python policyengine_us_data/datasets/acs/acs.py python policyengine_us_data/datasets/cps/cps.py python policyengine_us_data/datasets/puf/irs_puf.py @@ -43,8 +44,9 @@ data: python policyengine_us_data/datasets/cps/enhanced_cps.py clean: - rm -f policyengine_us_data/storage/puf_2015.csv - rm -f policyengine_us_data/storage/demographics_2015.csv + rm -f policyengine_us_data/storage/*.h5 + git clean -fX -- '*.csv' + rm -rf policyengine_us_data/docs/_build build: python -m build diff --git a/README.md b/README.md index 76e686a4..cc459fb3 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,17 @@ ## Installation +While it is possible to install via PyPi: ```bash pip install policyengine-us-data ``` +the recommended installion is +``` +pip install -e .[dev] +``` +which installs the development dependencies in a reference-only manner (so that changes +to the package code will be reflected immediately); `policyengine-us-data` is a dev package +and not intended for direct access. ## Building the Paper diff --git a/docs/add_plotly_to_book.py b/docs/add_plotly_to_book.py index 822e77ab..05d49cef 100644 --- a/docs/add_plotly_to_book.py +++ b/docs/add_plotly_to_book.py @@ -14,7 +14,7 @@ book_folder = Path(args.book_path) for html_file in book_folder.glob("**/*.html"): - with open(html_file, "r") as f: + with open(html_file, "r", encoding="utf-8") as f: html = f.read() # Add the script tag to the start of the tag. @@ -23,5 +23,5 @@ '', ) - with open(html_file, "w") as f: + with open(html_file, "w", encoding="utf-8") as f: f.write(html) diff --git a/policyengine_us_data/datasets/cps/cps.py b/policyengine_us_data/datasets/cps/cps.py index dd2fbb5e..7e916048 100644 --- a/policyengine_us_data/datasets/cps/cps.py +++ b/policyengine_us_data/datasets/cps/cps.py @@ -1,3 +1,4 @@ +from importlib.resources import files from policyengine_core.data import Dataset from policyengine_us_data.storage import STORAGE_FOLDER import h5py @@ -529,10 +530,13 @@ def add_personal_income_variables( year (int): The CPS year """ # Get income imputation parameters. - yamlfilename = os.path.join( - os.path.abspath(os.path.dirname(__file__)), - "imputation_parameters.yaml", + yamlfilename = ( + files("policyengine_us_data") + / "datasets" + / "cps" + / "imputation_parameters.yaml" ) + with open(yamlfilename, "r", encoding="utf-8") as yamlfile: p = yaml.safe_load(yamlfile) assert isinstance(p, dict) diff --git a/policyengine_us_data/datasets/puf/uprate_puf.py b/policyengine_us_data/datasets/puf/uprate_puf.py index a5c2b8d4..1cf0eb9c 100644 --- a/policyengine_us_data/datasets/puf/uprate_puf.py +++ b/policyengine_us_data/datasets/puf/uprate_puf.py @@ -2,6 +2,7 @@ import numpy as np from policyengine_us_data.storage import STORAGE_FOLDER + ITMDED_GROW_RATE = 0.02 # annual growth rate in itemized deduction amounts USE_VARIABLE_SPECIFIC_POPULATION_GROWTH_DIVISORS = False @@ -95,7 +96,6 @@ def get_soi_aggregate(variable, year, is_count): if variable == "adjusted_gross_income" and is_count: # AGI isn't treated like the other variables return get_soi_aggregate("count", year, True) - is_variable = soi.Variable == variable is_year = soi.Year == year filing_status = soi["Filing status"] == "All" diff --git a/policyengine_us_data/storage/uprating_factors.csv b/policyengine_us_data/storage/uprating_factors.csv deleted file mode 100644 index d16c4a91..00000000 --- a/policyengine_us_data/storage/uprating_factors.csv +++ /dev/null @@ -1,127 +0,0 @@ -Variable,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034 -alimony_expense,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -alimony_income,1.0,1.254,1.32,1.393,1.48,1.537,1.576,1.611,1.613,1.629,1.655,1.69,1.731,1.774,1.839 -ambulance_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -american_opportunity_credit,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -amt_foreign_tax_credit,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -casualty_loss,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -cdcc_relevant_expenses,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -charitable_cash_donations,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -charitable_non_cash_donations,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -child_support_expense,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -child_support_received,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -disability_benefits,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -domestic_production_ald,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -early_withdrawal_penalty,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -educator_expense,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -employment_income,1.0,1.068,1.147,1.197,1.254,1.303,1.353,1.402,1.455,1.51,1.564,1.619,1.677,1.736,1.797 -employment_income_before_lsr,1.0,1.068,1.147,1.197,1.254,1.303,1.353,1.402,1.455,1.51,1.564,1.619,1.677,1.736,1.797 -employment_income_last_year,1.0,1.068,1.147,1.197,1.254,1.303,1.353,1.402,1.455,1.51,1.564,1.619,1.677,1.736,1.797 -energy_efficient_home_improvement_credit,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -er_visit_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -estate_income,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -excess_withheld_payroll_tax,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -family_weight,1.0,1.004,1.008,1.018,1.029,1.039,1.046,1.052,1.057,1.061,1.065,1.068,1.072,1.075,1.078 -farm_income,1.0,1.865,1.86,1.898,2.055,2.153,2.224,2.298,2.37,2.441,2.524,2.611,2.703,2.798,2.899 -farm_rent_income,1.0,1.355,1.352,1.379,1.493,1.564,1.616,1.67,1.722,1.773,1.834,1.897,1.964,2.033,2.107 -foreign_tax_credit,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -free_school_meals_reported,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -general_business_credit,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -health_insurance_premiums,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -health_insurance_premiums_without_medicare_part_b,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -health_savings_account_ald,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -health_savings_account_payroll_contributions,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -household_weight,1.0,1.004,1.008,1.018,1.029,1.039,1.046,1.052,1.057,1.061,1.065,1.068,1.072,1.075,1.078 -imaging_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -inpatient_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -interest_deduction,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -investment_income_elected_form_4952,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -keogh_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -lab_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -long_term_capital_gains,1.0,1.822,1.107,0.809,1.158,1.213,1.171,1.134,1.13,1.147,1.176,1.211,1.25,1.293,1.338 -long_term_capital_gains_before_response,1.0,1.822,1.107,0.809,1.158,1.213,1.171,1.134,1.13,1.147,1.176,1.211,1.25,1.293,1.338 -long_term_capital_gains_on_collectibles,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -long_term_health_insurance_premiums,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -medical_out_of_pocket_expenses,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -medicare_part_b_premiums,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -misc_deduction,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -miscellaneous_income,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -non_qualified_dividend_income,1.0,1.198,1.263,1.313,1.339,1.404,1.475,1.528,1.577,1.635,1.737,1.837,1.934,2.028,2.119 -non_sch_d_capital_gains,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -other_credits,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -other_medical_expenses,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -outpatient_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -over_the_counter_health_expenses,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -partnership_s_corp_income,1.0,0.996,1.539,1.624,1.726,1.792,1.838,1.879,1.881,1.899,1.93,1.971,2.018,2.069,2.144 -person_weight,1.0,1.004,1.008,1.018,1.029,1.039,1.046,1.052,1.057,1.061,1.065,1.068,1.072,1.075,1.078 -physician_services_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -population,1.0,1.004,1.008,1.018,1.029,1.039,1.046,1.052,1.057,1.061,1.065,1.068,1.072,1.075,1.078 -pre_tax_contributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -prescription_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -prior_year_minimum_tax_credit,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -qualified_dividend_income,1.0,1.198,1.263,1.313,1.339,1.404,1.475,1.528,1.577,1.635,1.737,1.837,1.934,2.028,2.119 -qualified_tuition_expenses,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -real_estate_taxes,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -recapture_of_investment_credit,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -rent,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -rental_income,1.0,0.975,0.973,0.992,1.074,1.125,1.163,1.201,1.239,1.276,1.32,1.365,1.413,1.463,1.516 -roth_401k_contributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -roth_ira_contributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -salt_refund_income,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -savers_credit,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -self_employed_health_insurance_ald,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -self_employed_pension_contribution_ald,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -self_employed_pension_contributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -self_employment_income,1.0,1.254,1.32,1.393,1.48,1.537,1.576,1.611,1.613,1.629,1.655,1.69,1.731,1.774,1.839 -self_employment_income_before_lsr,1.0,1.254,1.32,1.393,1.48,1.537,1.576,1.611,1.613,1.629,1.655,1.69,1.731,1.774,1.839 -self_employment_income_last_year,1.0,1.254,1.32,1.393,1.48,1.537,1.576,1.611,1.613,1.629,1.655,1.69,1.731,1.774,1.839 -short_term_capital_gains,1.0,0.996,1.587,1.16,1.66,1.738,1.679,1.625,1.619,1.645,1.685,1.735,1.792,1.853,1.917 -snap_reported,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -social_security,1.0,1.274,1.409,1.571,1.78,1.941,2.068,2.186,2.315,2.463,2.613,2.751,2.906,3.073,3.246 -social_security_dependents,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -social_security_disability,1.0,0.996,0.992,1.068,1.091,1.115,1.133,1.155,1.171,1.192,1.214,1.236,1.26,1.284,1.31 -social_security_retirement,1.0,0.996,0.992,1.068,1.091,1.115,1.133,1.155,1.171,1.192,1.214,1.236,1.26,1.284,1.31 -social_security_survivors,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -spm_unit_broadband_subsidy_reported,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -spm_unit_capped_housing_subsidy_reported,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -spm_unit_capped_work_childcare_expenses,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -spm_unit_energy_subsidy_reported,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -spm_unit_federal_tax_reported,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -spm_unit_net_income_reported,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -spm_unit_payroll_tax_reported,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -spm_unit_pre_subsidy_childcare_expenses,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -spm_unit_spm_threshold,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -spm_unit_state_tax_reported,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -spm_unit_total_income_reported,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -spm_unit_weight,1.0,1.004,1.008,1.018,1.029,1.039,1.046,1.052,1.057,1.061,1.065,1.068,1.072,1.075,1.078 -spm_unit_wic_reported,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -ssi_reported,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -state_and_local_sales_or_income_tax,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -strike_benefits,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -student_loan_interest,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -tanf_reported,1.0,1.01,1.081,1.139,1.162,1.178,1.179,1.201,1.223,1.246,1.269,1.293,1.318,1.344,1.37 -tax_exempt_401k_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -tax_exempt_403b_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -tax_exempt_interest_income,1.0,0.805,0.957,1.171,1.255,1.346,1.386,1.45,1.558,1.66,1.703,1.743,1.792,1.825,1.865 -tax_exempt_ira_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -tax_exempt_pension_income,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -tax_exempt_private_pension_income,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -tax_exempt_sep_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -tax_unit_weight,1.0,1.004,1.008,1.018,1.029,1.039,1.046,1.052,1.057,1.061,1.065,1.068,1.072,1.075,1.078 -taxable_401k_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -taxable_403b_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -taxable_interest_income,1.0,0.805,0.957,1.171,1.255,1.346,1.386,1.45,1.558,1.66,1.703,1.743,1.792,1.825,1.865 -taxable_ira_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -taxable_pension_income,1.0,1.121,1.188,1.211,1.364,1.492,1.564,1.614,1.659,1.709,1.764,1.825,1.893,1.959,2.031 -taxable_private_pension_income,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -taxable_sep_distributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -taxable_unemployment_compensation,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -traditional_401k_contributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -traditional_ira_contributions,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -unemployment_compensation,1.0,0.511,0.566,0.63,0.714,0.779,0.83,0.877,0.929,0.988,1.048,1.104,1.166,1.233,1.303 -unrecaptured_section_1250_gain,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -unreported_payroll_tax,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -urgent_care_expense,1.0,1.104,1.168,1.241,1.3,1.328,1.359,1.403,1.448,1.493,1.541,1.591,1.643,1.697,1.753 -veterans_benefits,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -w2_wages_from_qualified_business,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 -workers_compensation,1.0,1.165,1.162,1.185,1.283,1.345,1.389,1.435,1.48,1.524,1.576,1.631,1.688,1.747,1.811 diff --git a/policyengine_us_data/storage/uprating_growth_factors.csv b/policyengine_us_data/storage/uprating_growth_factors.csv deleted file mode 100644 index 28ca744f..00000000 --- a/policyengine_us_data/storage/uprating_growth_factors.csv +++ /dev/null @@ -1,127 +0,0 @@ -Variable,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034 -alimony_expense,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -alimony_income,0,0.254,0.053,0.055,0.062,0.039,0.025,0.022,0.001,0.01,0.016,0.021,0.024,0.025,0.037 -ambulance_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -american_opportunity_credit,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -amt_foreign_tax_credit,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -casualty_loss,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -cdcc_relevant_expenses,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -charitable_cash_donations,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -charitable_non_cash_donations,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -child_support_expense,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -child_support_received,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -disability_benefits,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -domestic_production_ald,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -early_withdrawal_penalty,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -educator_expense,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -employment_income,0,0.068,0.074,0.044,0.048,0.039,0.038,0.036,0.038,0.038,0.036,0.035,0.036,0.035,0.035 -employment_income_before_lsr,0,0.068,0.074,0.044,0.048,0.039,0.038,0.036,0.038,0.038,0.036,0.035,0.036,0.035,0.035 -employment_income_last_year,0,0.068,0.074,0.044,0.048,0.039,0.038,0.036,0.038,0.038,0.036,0.035,0.036,0.035,0.035 -energy_efficient_home_improvement_credit,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -er_visit_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -estate_income,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -excess_withheld_payroll_tax,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -family_weight,0,0.004,0.004,0.01,0.011,0.01,0.007,0.006,0.005,0.004,0.004,0.003,0.004,0.003,0.003 -farm_income,0,0.865,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.034,0.035,0.035,0.036 -farm_rent_income,0,0.355,-0.002,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.034,0.035,0.035,0.036 -foreign_tax_credit,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -free_school_meals_reported,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -general_business_credit,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -health_insurance_premiums,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -health_insurance_premiums_without_medicare_part_b,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -health_savings_account_ald,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -health_savings_account_payroll_contributions,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -household_weight,0,0.004,0.004,0.01,0.011,0.01,0.007,0.006,0.005,0.004,0.004,0.003,0.004,0.003,0.003 -imaging_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -inpatient_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -interest_deduction,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -investment_income_elected_form_4952,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -keogh_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -lab_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -long_term_capital_gains,0,0.822,-0.392,-0.269,0.431,0.047,-0.035,-0.032,-0.004,0.015,0.025,0.03,0.032,0.034,0.035 -long_term_capital_gains_before_response,0,0.822,-0.392,-0.269,0.431,0.047,-0.035,-0.032,-0.004,0.015,0.025,0.03,0.032,0.034,0.035 -long_term_capital_gains_on_collectibles,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -long_term_health_insurance_premiums,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -medical_out_of_pocket_expenses,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -medicare_part_b_premiums,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -misc_deduction,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -miscellaneous_income,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -non_qualified_dividend_income,0,0.198,0.054,0.04,0.02,0.049,0.051,0.036,0.032,0.037,0.062,0.058,0.053,0.049,0.045 -non_sch_d_capital_gains,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -other_credits,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -other_medical_expenses,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -outpatient_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -over_the_counter_health_expenses,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -partnership_s_corp_income,0,-0.004,0.545,0.055,0.063,0.038,0.026,0.022,0.001,0.01,0.016,0.021,0.024,0.025,0.036 -person_weight,0,0.004,0.004,0.01,0.011,0.01,0.007,0.006,0.005,0.004,0.004,0.003,0.004,0.003,0.003 -physician_services_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -population,0,0.004,0.004,0.01,0.011,0.01,0.007,0.006,0.005,0.004,0.004,0.003,0.004,0.003,0.003 -pre_tax_contributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -prescription_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -prior_year_minimum_tax_credit,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -qualified_dividend_income,0,0.198,0.054,0.04,0.02,0.049,0.051,0.036,0.032,0.037,0.062,0.058,0.053,0.049,0.045 -qualified_tuition_expenses,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -real_estate_taxes,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -recapture_of_investment_credit,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -rent,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -rental_income,0,-0.025,-0.002,0.02,0.083,0.047,0.034,0.033,0.032,0.03,0.034,0.034,0.035,0.035,0.036 -roth_401k_contributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -roth_ira_contributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -salt_refund_income,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -savers_credit,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -self_employed_health_insurance_ald,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -self_employed_pension_contribution_ald,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -self_employed_pension_contributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -self_employment_income,0,0.254,0.053,0.055,0.062,0.039,0.025,0.022,0.001,0.01,0.016,0.021,0.024,0.025,0.037 -self_employment_income_before_lsr,0,0.254,0.053,0.055,0.062,0.039,0.025,0.022,0.001,0.01,0.016,0.021,0.024,0.025,0.037 -self_employment_income_last_year,0,0.254,0.053,0.055,0.062,0.039,0.025,0.022,0.001,0.01,0.016,0.021,0.024,0.025,0.037 -short_term_capital_gains,0,-0.004,0.593,-0.269,0.431,0.047,-0.034,-0.032,-0.004,0.016,0.024,0.03,0.033,0.034,0.035 -snap_reported,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -social_security,0,0.274,0.106,0.115,0.133,0.09,0.065,0.057,0.059,0.064,0.061,0.053,0.056,0.057,0.056 -social_security_dependents,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -social_security_disability,0,-0.004,-0.004,0.077,0.022,0.022,0.016,0.019,0.014,0.018,0.018,0.018,0.019,0.019,0.02 -social_security_retirement,0,-0.004,-0.004,0.077,0.022,0.022,0.016,0.019,0.014,0.018,0.018,0.018,0.019,0.019,0.02 -social_security_survivors,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -spm_unit_broadband_subsidy_reported,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -spm_unit_capped_housing_subsidy_reported,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -spm_unit_capped_work_childcare_expenses,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -spm_unit_energy_subsidy_reported,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -spm_unit_federal_tax_reported,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -spm_unit_net_income_reported,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -spm_unit_payroll_tax_reported,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -spm_unit_pre_subsidy_childcare_expenses,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -spm_unit_spm_threshold,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -spm_unit_state_tax_reported,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -spm_unit_total_income_reported,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -spm_unit_weight,0,0.004,0.004,0.01,0.011,0.01,0.007,0.006,0.005,0.004,0.004,0.003,0.004,0.003,0.003 -spm_unit_wic_reported,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -ssi_reported,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -state_and_local_sales_or_income_tax,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -strike_benefits,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -student_loan_interest,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -tanf_reported,0,0.01,0.07,0.054,0.02,0.014,0.001,0.019,0.018,0.019,0.018,0.019,0.019,0.02,0.019 -tax_exempt_401k_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -tax_exempt_403b_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -tax_exempt_interest_income,0,-0.195,0.189,0.224,0.072,0.073,0.03,0.046,0.074,0.065,0.026,0.023,0.028,0.018,0.022 -tax_exempt_ira_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -tax_exempt_pension_income,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -tax_exempt_private_pension_income,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -tax_exempt_sep_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -tax_unit_weight,0,0.004,0.004,0.01,0.011,0.01,0.007,0.006,0.005,0.004,0.004,0.003,0.004,0.003,0.003 -taxable_401k_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -taxable_403b_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -taxable_interest_income,0,-0.195,0.189,0.224,0.072,0.073,0.03,0.046,0.074,0.065,0.026,0.023,0.028,0.018,0.022 -taxable_ira_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -taxable_pension_income,0,0.121,0.06,0.019,0.126,0.094,0.048,0.032,0.028,0.03,0.032,0.035,0.037,0.035,0.037 -taxable_private_pension_income,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -taxable_sep_distributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -taxable_unemployment_compensation,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -traditional_401k_contributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -traditional_ira_contributions,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -unemployment_compensation,0,-0.489,0.108,0.113,0.133,0.091,0.065,0.057,0.059,0.064,0.061,0.053,0.056,0.057,0.057 -unrecaptured_section_1250_gain,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -unreported_payroll_tax,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -urgent_care_expense,0,0.104,0.058,0.063,0.048,0.022,0.023,0.032,0.032,0.031,0.032,0.032,0.033,0.033,0.033 -veterans_benefits,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -w2_wages_from_qualified_business,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 -workers_compensation,0,0.165,-0.003,0.02,0.083,0.048,0.033,0.033,0.031,0.03,0.034,0.035,0.035,0.035,0.037 diff --git a/policyengine_us_data/utils/github.py b/policyengine_us_data/utils/github.py index 007a8d68..af74c526 100644 --- a/policyengine_us_data/utils/github.py +++ b/policyengine_us_data/utils/github.py @@ -6,16 +6,20 @@ from requests.packages.urllib3.util.retry import Retry import time -auth_headers = { - "Authorization": f"token {os.environ.get('POLICYENGINE_US_DATA_GITHUB_TOKEN')}", -} + +TOKEN = os.environ.get("POLICYENGINE_US_DATA_GITHUB_TOKEN") + +if TOKEN: + AUTH_HEADERS = {"Authorization": f"token {TOKEN}"} +else: + AUTH_HEADERS = {} def get_asset_url( org: str, repo: str, release_tag: str, file_name: str ) -> str: url = f"https://api.github.com/repos/{org}/{repo}/releases/tags/{release_tag}" - response = requests.get(url, headers=auth_headers) + response = requests.get(url, headers=AUTH_HEADERS) if response.status_code != 200: raise ValueError( f"Invalid response code {response.status_code} for url {url}." @@ -32,7 +36,7 @@ def get_asset_url( def get_release_id(org: str, repo: str, release_tag: str) -> int: url = f"https://api.github.com/repos/{org}/{repo}/releases/tags/{release_tag}" - response = requests.get(url, headers=auth_headers) + response = requests.get(url, headers=AUTH_HEADERS) if response.status_code == 404: raise ValueError(f"Release {release_tag} not found in {org}/{repo}.") elif response.status_code != 200: @@ -44,7 +48,7 @@ def get_release_id(org: str, repo: str, release_tag: str) -> int: def get_all_assets(org: str, repo: str, release_id: int) -> list: url = f"https://api.github.com/repos/{org}/{repo}/releases/{release_id}/assets" - response = requests.get(url, headers=auth_headers) + response = requests.get(url, headers=AUTH_HEADERS) if response.status_code != 200: raise ValueError( f"Invalid response code {response.status_code} for url {url}." @@ -73,7 +77,7 @@ def delete_asset(org: str, repo: str, asset_id: int): ) headers = { "Accept": "application/vnd.github.v3+json", - **auth_headers, + **AUTH_HEADERS, } response = requests.delete(url, headers=headers) @@ -96,7 +100,7 @@ def download( stream=True, headers={ "Accept": "application/octet-stream", - **auth_headers, + **AUTH_HEADERS, }, ) @@ -177,7 +181,7 @@ def create_asset( "Accept": "application/vnd.github.v3+json", "Content-Type": "application/octet-stream", "Content-Length": str(file_size), - **auth_headers, + **AUTH_HEADERS, } session = create_session_with_retries() @@ -229,7 +233,7 @@ def set_pr_auto_review_comment(text: str): response = requests.post( url, - headers=auth_headers, + headers=AUTH_HEADERS, json={ "body": text, "event": "COMMENT", diff --git a/policyengine_us_data/utils/huggingface.py b/policyengine_us_data/utils/huggingface.py index b88149b2..fcd07ee0 100644 --- a/policyengine_us_data/utils/huggingface.py +++ b/policyengine_us_data/utils/huggingface.py @@ -3,12 +3,18 @@ import pkg_resources +TOKEN = os.environ.get("HUGGING_FACE_TOKEN") +if not TOKEN: + raise ValueError( + "Required environment variable 'HUGGING_FACE_TOKEN' is not set. " + "This token is needed to download files from Hugging Face Hub. " + "Please set the HUGGING_FACE_TOKEN environment variable." + ) + + def download( repo: str, repo_filename: str, local_folder: str, version: str = None ): - token = os.environ.get( - "HUGGING_FACE_TOKEN", - ) hf_hub_download( repo_id=repo, @@ -16,19 +22,16 @@ def download( filename=repo_filename, local_dir=local_folder, revision=version, - token=token, + token=TOKEN, ) def upload(local_file_path: str, repo: str, repo_file_path: str): - token = os.environ.get( - "HUGGING_FACE_TOKEN", - ) api = HfApi() api.upload_file( path_or_fileobj=local_file_path, path_in_repo=repo_file_path, repo_id=repo, repo_type="model", - token=token, + token=TOKEN, ) diff --git a/pyproject.toml b/pyproject.toml index 1d536d92..fd7c1e6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,11 +17,12 @@ authors = [ license = {file = "LICENSE"} requires-python = ">=3.11, <3.13.0" dependencies = [ - "policyengine_us>=1.197.0", - "policyengine_core>=3.14.1", + "policyengine-us>=1.197.0", + "policyengine-core>=3.14.1", "requests", "tqdm", "microdf_python>=0.4.3", + "setuptools>=60", "microimpute>=0.1.2", "pip-system-certs", "google-cloud-storage", @@ -73,4 +74,4 @@ extend-exclude = ''' | build | dist )/ -''' \ No newline at end of file +'''