policyengine-us 1.353.0__py3-none-any.whl → 1.355.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of policyengine-us might be problematic. Click here for more details.
- policyengine_us/parameters/gov/aca/ineligible_immigration_statuses.yaml +11 -0
- policyengine_us/parameters/gov/hhs/medicaid/eligibility/work_requirements/age_range.yaml +25 -0
- policyengine_us/parameters/gov/hhs/medicaid/eligibility/work_requirements/applies.yaml +13 -0
- policyengine_us/parameters/gov/hhs/medicaid/eligibility/work_requirements/dependent_age_limit.yaml +12 -0
- policyengine_us/parameters/gov/hhs/medicaid/eligibility/work_requirements/monthly_hours_threshold.yaml +12 -0
- policyengine_us/parameters/gov/irs/credits/cdcc/phase_out/amended_structure/applies.yaml +13 -0
- policyengine_us/parameters/gov/irs/credits/cdcc/phase_out/amended_structure/second_increment.yaml +19 -0
- policyengine_us/parameters/gov/irs/credits/cdcc/phase_out/amended_structure/second_min.yaml +11 -0
- policyengine_us/parameters/gov/irs/credits/cdcc/phase_out/amended_structure/second_start.yaml +21 -0
- policyengine_us/parameters/gov/irs/credits/cdcc/phase_out/max.yaml +2 -0
- policyengine_us/parameters/gov/irs/credits/cdcc/phase_out/min.yaml +2 -0
- policyengine_us/parameters/gov/irs/credits/ctc/adult_ssn_requirement_applies.yaml +11 -0
- policyengine_us/parameters/gov/irs/credits/ctc/child_ssn_requirement_applies.yaml +0 -1
- policyengine_us/parameters/gov/irs/credits/ctc/eligible_ssn_card_type.yaml +13 -0
- policyengine_us/parameters/gov/irs/deductions/auto_loan_interest/cap.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/auto_loan_interest/phase_out/increment.yaml +11 -0
- policyengine_us/parameters/gov/irs/deductions/auto_loan_interest/phase_out/start.yaml +21 -0
- policyengine_us/parameters/gov/irs/deductions/auto_loan_interest/phase_out/step.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/deductions_if_itemizing.yaml +14 -0
- policyengine_us/parameters/gov/irs/deductions/deductions_if_not_itemizing.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/casualty/active.yaml +0 -1
- policyengine_us/parameters/gov/irs/deductions/itemized/charity/ceiling/all.yaml +0 -1
- policyengine_us/parameters/gov/irs/deductions/itemized/charity/ceiling/non_cash.yaml +2 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/charity/floor/amount.yaml +11 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/charity/floor/applies.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/charity/non_itemizers_amount.yaml +8 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/interest/mortgage/cap.yaml +0 -5
- policyengine_us/parameters/gov/irs/deductions/itemized/misc/applies.yaml +0 -1
- policyengine_us/parameters/gov/irs/deductions/itemized/reduction/amended_structure/applies.yaml +13 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/reduction/amended_structure/rate.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/salt_and_real_estate/cap.yaml +30 -5
- policyengine_us/parameters/gov/irs/deductions/itemized/salt_and_real_estate/phase_out/floor/amount.yaml +21 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/salt_and_real_estate/phase_out/floor/applies.yaml +13 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/salt_and_real_estate/phase_out/in_effect.yaml +13 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/salt_and_real_estate/phase_out/rate.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/itemized/salt_and_real_estate/phase_out/threshold.yaml +41 -0
- policyengine_us/parameters/gov/irs/deductions/overtime_income/cap.yaml +22 -0
- policyengine_us/parameters/gov/irs/deductions/overtime_income/eligible_ssn_card_type.yaml +13 -0
- policyengine_us/parameters/gov/irs/deductions/overtime_income/phase_out/rate.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/overtime_income/phase_out/start.yaml +22 -0
- policyengine_us/parameters/gov/irs/deductions/qbi/deduction_floor/amount.yaml +21 -0
- policyengine_us/parameters/gov/irs/deductions/qbi/deduction_floor/in_effect.yaml +13 -0
- policyengine_us/parameters/gov/irs/deductions/qbi/max/business_property/rate.yaml +1 -6
- policyengine_us/parameters/gov/irs/deductions/qbi/max/rate.yaml +1 -2
- policyengine_us/parameters/gov/irs/deductions/qbi/max/w2_wages/alt_rate.yaml +1 -6
- policyengine_us/parameters/gov/irs/deductions/qbi/max/w2_wages/rate.yaml +1 -6
- policyengine_us/parameters/gov/irs/deductions/qbi/phase_out/length.yaml +12 -10
- policyengine_us/parameters/gov/irs/deductions/qbi/phase_out/start.yaml +7 -5
- policyengine_us/parameters/gov/irs/deductions/senior_deduction/amount.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/senior_deduction/eligible_ssn_card_type.yaml +13 -0
- policyengine_us/parameters/gov/irs/deductions/senior_deduction/phase_out_rate/joint.yaml +20 -0
- policyengine_us/parameters/gov/irs/deductions/senior_deduction/phase_out_rate/other.yaml +20 -0
- policyengine_us/parameters/gov/irs/deductions/tip_income/cap.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/tip_income/eligible_ssn_card_type.yaml +13 -0
- policyengine_us/parameters/gov/irs/deductions/tip_income/phase_out/rate.yaml +12 -0
- policyengine_us/parameters/gov/irs/deductions/tip_income/phase_out/start.yaml +22 -0
- policyengine_us/parameters/gov/usda/snap/work_requirements/abawd/age_threshold/dependent.yaml +4 -2
- policyengine_us/parameters/gov/usda/snap/work_requirements/abawd/age_threshold/exempted.yaml +4 -1
- policyengine_us/parameters/gov/usda/snap/work_requirements/abawd/amended_structure/in_effect.yaml +13 -0
- policyengine_us/parameters/gov/usda/snap/work_requirements/abawd/amended_structure/sunset_provisions_apply.yaml +13 -0
- policyengine_us/parameters/gov/usda/snap/work_requirements/general/age_threshold/caring_dependent_child.yaml +1 -1
- policyengine_us/parameters/gov/usda/snap/work_requirements/general/age_threshold/exempted.yaml +1 -1
- policyengine_us/parameters/gov/usda/snap/work_requirements/general/weekly_hours_threshold.yaml +1 -1
- policyengine_us/reforms/reconciliation/__init__.py +0 -36
- policyengine_us/reforms/reforms.py +0 -63
- policyengine_us/tests/policy/baseline/gov/hhs/medicaid/eligibility/medicaid_work_requirement_eligible.yaml +88 -0
- policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/cdcc_rate.yaml +40 -0
- policyengine_us/tests/policy/baseline/gov/irs/credits/ctc/maximum/individual/filer_meets_ctc_identification_requirements.yaml +51 -0
- policyengine_us/tests/policy/baseline/gov/irs/credits/ctc/maximum/individual/meets_ctc_child_identification_requirements.yaml +2 -2
- policyengine_us/tests/policy/baseline/gov/irs/deductions/itemized/salt_and_real_estate/reported_salt.yaml +2 -4
- policyengine_us/tests/policy/baseline/gov/irs/deductions/itemized/salt_and_real_estate/salt_deduction.yaml +78 -0
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/auto_loan_interest_deduction.yaml +26 -0
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/charitable_deduction.yaml +42 -6
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_taxable_income_deductions_reduction.yaml +18 -5
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/misc_deduction.yaml +0 -18
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/overtime_income/overtime_income_deduction.yaml +39 -0
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/overtime_income/overtime_income_deduction_ssn_requirement_met.yaml +53 -0
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/qbid/qualified_business_income_deduction.yaml +33 -0
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/senior_deduction/integration.yaml +107 -0
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/senior_deduction/meets_additional_senior_deduction_identification_requirements.yaml +71 -0
- policyengine_us/tests/policy/{contrib/reconciliation/reconciled_tip_and_overtime_exempt.yaml → baseline/gov/irs/income/taxable_income/deductions/tip_and_overtime_income_deduction.yaml} +39 -114
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/tip_income/tip_income_deduction.yaml +79 -0
- policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/tip_income/tip_income_deduction_ineligible_cardholder_present.yaml +53 -0
- policyengine_us/tests/policy/baseline/gov/usda/snap/eligibility/work_requirements/meets_snap_abawd_work_requirements.yaml +105 -0
- policyengine_us/variables/gov/hhs/medicaid/eligibility/is_medicaid_eligible.py +9 -0
- policyengine_us/variables/gov/hhs/medicaid/eligibility/medicaid_work_requirement_eligible.py +57 -0
- policyengine_us/variables/gov/irs/credits/cdcc/cdcc_rate.py +18 -0
- policyengine_us/variables/gov/irs/credits/ctc/ctc.py +1 -0
- policyengine_us/variables/gov/irs/credits/ctc/maximum/individual/filer_meets_ctc_identification_requirements.py +20 -0
- policyengine_us/variables/gov/irs/credits/ctc/maximum/individual/meets_ctc_child_identification_requirements.py +3 -6
- policyengine_us/variables/gov/irs/credits/ctc/maximum/individual/meets_ctc_identification_requirements.py +17 -0
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/auto_loan_interest/auto_loan_interest_deduction.py +30 -0
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/charitable_deduction.py +18 -3
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_taxable_income_deductions_reduction.py +18 -0
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/salt_cap.py +12 -2
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/overtime_income/overtime_income_deduction.py +24 -0
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/overtime_income/overtime_income_deduction_ssn_requirement_met.py +25 -0
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/qualified_business_income_deduction/qualified_business_income_deduction.py +10 -3
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/senior_deduction/additional_senior_deduction.py +31 -0
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/senior_deduction/additional_senior_deduction_eligible_person.py +24 -0
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/tax_unit_itemizes.py +0 -1
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/tip_income/tip_income_deduction.py +23 -0
- policyengine_us/variables/gov/irs/income/taxable_income/deductions/tip_income/tip_income_deduction_ssn_requirement_met.py +25 -0
- policyengine_us/variables/gov/usda/snap/eligibility/work_requirements/meets_snap_abawd_work_requirements.py +37 -7
- {policyengine_us-1.353.0.dist-info → policyengine_us-1.355.0.dist-info}/METADATA +1 -1
- {policyengine_us-1.353.0.dist-info → policyengine_us-1.355.0.dist-info}/RECORD +109 -118
- policyengine_us/parameters/gov/contrib/reconciliation/aca_ptc_immigration_status/in_effect.yaml +0 -13
- policyengine_us/parameters/gov/contrib/reconciliation/additional_senior_standard_deduction/amount.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/additional_senior_standard_deduction/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/additional_senior_standard_deduction/rate/joint.yaml +0 -20
- policyengine_us/parameters/gov/contrib/reconciliation/additional_senior_standard_deduction/rate/other.yaml +0 -20
- policyengine_us/parameters/gov/contrib/reconciliation/auto_loan_interest_ald/cap.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/auto_loan_interest_ald/in_effect.yaml +0 -13
- policyengine_us/parameters/gov/contrib/reconciliation/auto_loan_interest_ald/phase_out/increment.yaml +0 -11
- policyengine_us/parameters/gov/contrib/reconciliation/auto_loan_interest_ald/phase_out/start.yaml +0 -21
- policyengine_us/parameters/gov/contrib/reconciliation/auto_loan_interest_ald/phase_out/step.yaml +0 -11
- policyengine_us/parameters/gov/contrib/reconciliation/auto_loan_interest_ald/senate_version/applies.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/cdcc/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/cdcc/phase_out/second_increment.yaml +0 -19
- policyengine_us/parameters/gov/contrib/reconciliation/cdcc/phase_out/second_min.yaml +0 -11
- policyengine_us/parameters/gov/contrib/reconciliation/cdcc/phase_out/second_start.yaml +0 -19
- policyengine_us/parameters/gov/contrib/reconciliation/charitable_donations/floor.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/charitable_donations/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/ctc/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/ctc/one_person_ssn_req.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/overtime_income_exempt/cap.yaml +0 -22
- policyengine_us/parameters/gov/contrib/reconciliation/overtime_income_exempt/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/overtime_income_exempt/phase_out/applies.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/overtime_income_exempt/phase_out/rate.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/overtime_income_exempt/phase_out/start.yaml +0 -24
- policyengine_us/parameters/gov/contrib/reconciliation/pease/amended_structure/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/pease/amended_structure/salt_rate.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/pease/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/pease/rate.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/qbid/deduction_floor/amount.yaml +0 -21
- policyengine_us/parameters/gov/contrib/reconciliation/qbid/deduction_floor/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/qbid/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/qbid/phase_out_rate.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/qbid/use_bdc_income.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/tip_income_exempt/cap.yaml +0 -22
- policyengine_us/parameters/gov/contrib/reconciliation/tip_income_exempt/in_effect.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/tip_income_exempt/phase_out/applies.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/tip_income_exempt/phase_out/rate.yaml +0 -12
- policyengine_us/parameters/gov/contrib/reconciliation/tip_income_exempt/phase_out/start.yaml +0 -23
- policyengine_us/parameters/gov/contrib/salt_phase_out/floor/amount.yaml +0 -21
- policyengine_us/parameters/gov/contrib/salt_phase_out/floor/applies.yaml +0 -11
- policyengine_us/parameters/gov/contrib/salt_phase_out/in_effect.yaml +0 -8
- policyengine_us/parameters/gov/contrib/salt_phase_out/rate.yaml +0 -13
- policyengine_us/parameters/gov/contrib/salt_phase_out/threshold.yaml +0 -21
- policyengine_us/reforms/reconciliation/aca_ptc_immigration_status.py +0 -55
- policyengine_us/reforms/reconciliation/ctc_ssn.py +0 -86
- policyengine_us/reforms/reconciliation/reconciled_additional_senior_standard_deduction.py +0 -151
- policyengine_us/reforms/reconciliation/reconciled_auto_loan_interest_ald.py +0 -153
- policyengine_us/reforms/reconciliation/reconciled_medicaid_work_requirement.py +0 -157
- policyengine_us/reforms/reconciliation/reconciled_pease.py +0 -85
- policyengine_us/reforms/reconciliation/reconciled_qbid.py +0 -78
- policyengine_us/reforms/reconciliation/reconciled_snap_abawd_work_requirement.py +0 -125
- policyengine_us/reforms/reconciliation/reconciled_tip_and_overtime_exempt.py +0 -177
- policyengine_us/reforms/reconciliation/reconciliation_cdcc.py +0 -78
- policyengine_us/reforms/reconciliation/reconciliation_charitable_deduction.py +0 -78
- policyengine_us/reforms/reconciliation/reconciliation_qbid_with_floor.py +0 -72
- policyengine_us/reforms/salt_phase_out/__init__.py +0 -3
- policyengine_us/reforms/salt_phase_out/salt_phase_out_reform.py +0 -59
- policyengine_us/tests/policy/contrib/reconciliation/ctc_ssn.yaml +0 -150
- policyengine_us/tests/policy/contrib/reconciliation/reconciled_additional_senior_standard_deduction.yaml +0 -173
- policyengine_us/tests/policy/contrib/reconciliation/reconciled_auto_loan_interest_ald.yaml +0 -96
- policyengine_us/tests/policy/contrib/reconciliation/reconciled_pease.yaml +0 -85
- policyengine_us/tests/policy/contrib/reconciliation/reconciled_qbid.yaml +0 -31
- policyengine_us/tests/policy/contrib/reconciliation/reconciled_snap_abawd_work_requirement.yaml +0 -118
- policyengine_us/tests/policy/contrib/reconciliation/reconciliation_cdcc.yaml +0 -59
- policyengine_us/tests/policy/contrib/reconciliation/reconciliation_charitable_deduction.yaml +0 -58
- policyengine_us/tests/policy/contrib/reconciliation/reconciliation_qbid_with_floor.yaml +0 -38
- policyengine_us/tests/policy/contrib/salt_phase_out/salt_phase_out_reform.yaml +0 -118
- {policyengine_us-1.353.0.dist-info → policyengine_us-1.355.0.dist-info}/WHEEL +0 -0
- {policyengine_us-1.353.0.dist-info → policyengine_us-1.355.0.dist-info}/entry_points.txt +0 -0
- {policyengine_us-1.353.0.dist-info → policyengine_us-1.355.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
from policyengine_us.model_api import *
|
|
2
|
-
from policyengine_core.periods import period as period_
|
|
3
|
-
from policyengine_core.periods import instant
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def create_aca_ptc_immigration_status() -> Reform:
|
|
7
|
-
|
|
8
|
-
def modify_parameters(parameters):
|
|
9
|
-
parameters.gov.aca.ineligible_immigration_statuses.update(
|
|
10
|
-
start=instant("2027-01-01"),
|
|
11
|
-
stop=instant("2035-12-31"),
|
|
12
|
-
value=[
|
|
13
|
-
"ASYLEE",
|
|
14
|
-
"DACA_TPS", # daca is eligible
|
|
15
|
-
"DEPORTATION_WITHHELD",
|
|
16
|
-
"PAROLED_ONE_YEAR",
|
|
17
|
-
"UNDOCUMENTED",
|
|
18
|
-
"TPS", # tps is NOT eligible
|
|
19
|
-
],
|
|
20
|
-
)
|
|
21
|
-
return parameters
|
|
22
|
-
|
|
23
|
-
class reform(Reform):
|
|
24
|
-
def apply(self):
|
|
25
|
-
self.modify_parameters(modify_parameters)
|
|
26
|
-
|
|
27
|
-
return reform
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def create_aca_ptc_immigration_status_reform(
|
|
31
|
-
parameters, period, bypass: bool = False
|
|
32
|
-
):
|
|
33
|
-
if bypass:
|
|
34
|
-
return create_aca_ptc_immigration_status()
|
|
35
|
-
|
|
36
|
-
p = parameters.gov.contrib.reconciliation.aca_ptc_immigration_status
|
|
37
|
-
|
|
38
|
-
reform_active = False
|
|
39
|
-
current_period = period_(period)
|
|
40
|
-
|
|
41
|
-
for i in range(5):
|
|
42
|
-
if p(current_period).in_effect:
|
|
43
|
-
reform_active = True
|
|
44
|
-
break
|
|
45
|
-
current_period = current_period.offset(1, "year")
|
|
46
|
-
|
|
47
|
-
if reform_active:
|
|
48
|
-
return create_aca_ptc_immigration_status()
|
|
49
|
-
else:
|
|
50
|
-
return None
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
aca_ptc_immigration_status = create_aca_ptc_immigration_status_reform(
|
|
54
|
-
None, None, bypass=True
|
|
55
|
-
)
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
from policyengine_us.model_api import *
|
|
2
|
-
from policyengine_core.periods import period as period_
|
|
3
|
-
from policyengine_core.periods import instant
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def create_ctc_ssn() -> Reform:
|
|
7
|
-
class ctc(Variable):
|
|
8
|
-
value_type = float
|
|
9
|
-
entity = TaxUnit
|
|
10
|
-
label = "Child Tax Credit"
|
|
11
|
-
unit = USD
|
|
12
|
-
documentation = "Total value of the non-refundable and refundable portions of the Child Tax Credit."
|
|
13
|
-
definition_period = YEAR
|
|
14
|
-
reference = "https://www.law.cornell.edu/uscode/text/26/24#a"
|
|
15
|
-
defined_for = "filer_meets_ctc_identification_requirements"
|
|
16
|
-
|
|
17
|
-
def formula(tax_unit, period, parameters):
|
|
18
|
-
maximum_amount = tax_unit("ctc_maximum_with_arpa_addition", period)
|
|
19
|
-
reduction = tax_unit("ctc_phase_out", period)
|
|
20
|
-
return max_(0, maximum_amount - reduction)
|
|
21
|
-
|
|
22
|
-
class filer_meets_ctc_identification_requirements(Variable):
|
|
23
|
-
value_type = bool
|
|
24
|
-
entity = TaxUnit
|
|
25
|
-
definition_period = YEAR
|
|
26
|
-
label = "Filer meets CTC identification requirements"
|
|
27
|
-
|
|
28
|
-
def formula(tax_unit, period, parameters):
|
|
29
|
-
# Both head and spouse in the tax unit must have valid SSN card type to be eligible for the CTC
|
|
30
|
-
person = tax_unit.members
|
|
31
|
-
head_or_spouse = person("is_tax_unit_head_or_spouse", period)
|
|
32
|
-
eligible_ssn_card_type = person(
|
|
33
|
-
"meets_ctc_identification_requirements", period
|
|
34
|
-
)
|
|
35
|
-
p = parameters(period).gov.contrib.reconciliation.ctc
|
|
36
|
-
if p.one_person_ssn_req:
|
|
37
|
-
return tax_unit.any(head_or_spouse & eligible_ssn_card_type)
|
|
38
|
-
return ~tax_unit.any(head_or_spouse & ~eligible_ssn_card_type)
|
|
39
|
-
|
|
40
|
-
class meets_ctc_identification_requirements(Variable):
|
|
41
|
-
value_type = bool
|
|
42
|
-
entity = Person
|
|
43
|
-
definition_period = YEAR
|
|
44
|
-
label = "Person meets CTC identification requirements"
|
|
45
|
-
reference = "https://docs.house.gov/meetings/WM/WM00/20250513/118260/BILLS-119CommitteePrintih.pdf#page=4"
|
|
46
|
-
|
|
47
|
-
def formula(person, period, parameters):
|
|
48
|
-
ssn_card_type = person("ssn_card_type", period)
|
|
49
|
-
ssn_card_types = ssn_card_type.possible_values
|
|
50
|
-
citizen = ssn_card_type == ssn_card_types.CITIZEN
|
|
51
|
-
non_citizen_valid_ead = (
|
|
52
|
-
ssn_card_type == ssn_card_types.NON_CITIZEN_VALID_EAD
|
|
53
|
-
)
|
|
54
|
-
return citizen | non_citizen_valid_ead
|
|
55
|
-
|
|
56
|
-
class reform(Reform):
|
|
57
|
-
def apply(self):
|
|
58
|
-
self.update_variable(ctc)
|
|
59
|
-
self.update_variable(filer_meets_ctc_identification_requirements)
|
|
60
|
-
self.update_variable(meets_ctc_identification_requirements)
|
|
61
|
-
|
|
62
|
-
return reform
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def create_ctc_ssn_reform(parameters, period, bypass: bool = False):
|
|
66
|
-
if bypass:
|
|
67
|
-
return create_ctc_ssn()
|
|
68
|
-
|
|
69
|
-
p = parameters.gov.contrib.reconciliation.ctc
|
|
70
|
-
|
|
71
|
-
reform_active = False
|
|
72
|
-
current_period = period_(period)
|
|
73
|
-
|
|
74
|
-
for i in range(5):
|
|
75
|
-
if p(current_period).in_effect:
|
|
76
|
-
reform_active = True
|
|
77
|
-
break
|
|
78
|
-
current_period = current_period.offset(1, "year")
|
|
79
|
-
|
|
80
|
-
if reform_active:
|
|
81
|
-
return create_ctc_ssn()
|
|
82
|
-
else:
|
|
83
|
-
return None
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
ctc_ssn = create_ctc_ssn_reform(None, None, bypass=True)
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
from policyengine_us.model_api import *
|
|
2
|
-
from policyengine_core.periods import period as period_
|
|
3
|
-
from policyengine_core.periods import instant
|
|
4
|
-
import numpy as np
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def create_reconciled_additional_senior_standard_deduction() -> Reform:
|
|
8
|
-
class additional_senior_standard_deduction(Variable):
|
|
9
|
-
value_type = float
|
|
10
|
-
entity = TaxUnit
|
|
11
|
-
label = "Additional senior standard deduction"
|
|
12
|
-
unit = USD
|
|
13
|
-
definition_period = YEAR
|
|
14
|
-
defined_for = "filer_meets_additional_senior_standard_deduction_identification_requirements"
|
|
15
|
-
reference = "https://punchbowl.news/smitmo_017_xml/" # page 35
|
|
16
|
-
|
|
17
|
-
def formula(tax_unit, period, parameters):
|
|
18
|
-
p = parameters(
|
|
19
|
-
period
|
|
20
|
-
).gov.contrib.reconciliation.additional_senior_standard_deduction
|
|
21
|
-
aged_head = tax_unit("aged_head", period).astype(int)
|
|
22
|
-
aged_spouse = tax_unit("aged_spouse", period).astype(int)
|
|
23
|
-
aged_count = aged_spouse + aged_head
|
|
24
|
-
base_deduction = p.amount * aged_count
|
|
25
|
-
agi = tax_unit("adjusted_gross_income", period)
|
|
26
|
-
filing_status = tax_unit("filing_status", period)
|
|
27
|
-
joint = filing_status == filing_status.possible_values.JOINT
|
|
28
|
-
phase_out_amount = where(
|
|
29
|
-
joint, p.rate.joint.calc(agi), p.rate.other.calc(agi)
|
|
30
|
-
)
|
|
31
|
-
return max_(base_deduction - phase_out_amount, 0)
|
|
32
|
-
|
|
33
|
-
class filer_meets_additional_senior_standard_deduction_identification_requirements(
|
|
34
|
-
Variable
|
|
35
|
-
):
|
|
36
|
-
value_type = bool
|
|
37
|
-
entity = TaxUnit
|
|
38
|
-
definition_period = YEAR
|
|
39
|
-
label = "Filer meets additional senior standard deduction identification requirements"
|
|
40
|
-
|
|
41
|
-
def formula(tax_unit, period, parameters):
|
|
42
|
-
# Both head and spouse in the tax unit must have valid SSN card type to be eligible for the CTC
|
|
43
|
-
person = tax_unit.members
|
|
44
|
-
is_head_or_spouse = person("is_tax_unit_head_or_spouse", period)
|
|
45
|
-
eligible_ssn_card_type = person(
|
|
46
|
-
"meets_additional_senior_standard_deduction_identification_requirements",
|
|
47
|
-
period,
|
|
48
|
-
)
|
|
49
|
-
ineligible_head_or_spouse = (
|
|
50
|
-
is_head_or_spouse & ~eligible_ssn_card_type
|
|
51
|
-
)
|
|
52
|
-
return tax_unit.sum(ineligible_head_or_spouse) == 0
|
|
53
|
-
|
|
54
|
-
class meets_additional_senior_standard_deduction_identification_requirements(
|
|
55
|
-
Variable
|
|
56
|
-
):
|
|
57
|
-
value_type = bool
|
|
58
|
-
entity = Person
|
|
59
|
-
definition_period = YEAR
|
|
60
|
-
label = "Person meets additional standard deduction identification requirements"
|
|
61
|
-
reference = "https://punchbowl.news/smitmo_017_xml/" # page 35
|
|
62
|
-
|
|
63
|
-
def formula(person, period, parameters):
|
|
64
|
-
ssn_card_type = person("ssn_card_type", period)
|
|
65
|
-
ssn_card_types = ssn_card_type.possible_values
|
|
66
|
-
citizen = ssn_card_type == ssn_card_types.CITIZEN
|
|
67
|
-
non_citizen_valid_ead = (
|
|
68
|
-
ssn_card_type == ssn_card_types.NON_CITIZEN_VALID_EAD
|
|
69
|
-
)
|
|
70
|
-
return citizen | non_citizen_valid_ead
|
|
71
|
-
|
|
72
|
-
class taxable_income_deductions_if_itemizing(Variable):
|
|
73
|
-
value_type = float
|
|
74
|
-
entity = TaxUnit
|
|
75
|
-
label = "Deductions if itemizing"
|
|
76
|
-
unit = USD
|
|
77
|
-
reference = "https://www.law.cornell.edu/uscode/text/26/63"
|
|
78
|
-
definition_period = YEAR
|
|
79
|
-
|
|
80
|
-
def formula(tax_unit, period, parameters):
|
|
81
|
-
p = parameters(period).gov.irs.deductions
|
|
82
|
-
existing_deductions = add(
|
|
83
|
-
tax_unit, period, p.deductions_if_itemizing
|
|
84
|
-
)
|
|
85
|
-
additional_deduction = tax_unit(
|
|
86
|
-
"additional_senior_standard_deduction", period
|
|
87
|
-
)
|
|
88
|
-
return existing_deductions + additional_deduction
|
|
89
|
-
|
|
90
|
-
class taxable_income_deductions_if_not_itemizing(Variable):
|
|
91
|
-
value_type = float
|
|
92
|
-
entity = TaxUnit
|
|
93
|
-
label = "Deductions if not itemizing"
|
|
94
|
-
unit = USD
|
|
95
|
-
definition_period = YEAR
|
|
96
|
-
|
|
97
|
-
def formula(tax_unit, period, parameters):
|
|
98
|
-
p = parameters(period).gov.irs.deductions
|
|
99
|
-
existing_deductions = add(
|
|
100
|
-
tax_unit, period, p.deductions_if_not_itemizing
|
|
101
|
-
)
|
|
102
|
-
additional_deduction = tax_unit(
|
|
103
|
-
"additional_senior_standard_deduction", period
|
|
104
|
-
)
|
|
105
|
-
return existing_deductions + additional_deduction
|
|
106
|
-
|
|
107
|
-
class reform(Reform):
|
|
108
|
-
def apply(self):
|
|
109
|
-
self.update_variable(
|
|
110
|
-
meets_additional_senior_standard_deduction_identification_requirements
|
|
111
|
-
)
|
|
112
|
-
self.update_variable(
|
|
113
|
-
filer_meets_additional_senior_standard_deduction_identification_requirements
|
|
114
|
-
)
|
|
115
|
-
self.update_variable(additional_senior_standard_deduction)
|
|
116
|
-
self.update_variable(taxable_income_deductions_if_not_itemizing)
|
|
117
|
-
self.update_variable(taxable_income_deductions_if_itemizing)
|
|
118
|
-
|
|
119
|
-
return reform
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
def create_reconciled_additional_senior_standard_deduction_reform(
|
|
123
|
-
parameters, period, bypass: bool = False
|
|
124
|
-
):
|
|
125
|
-
if bypass:
|
|
126
|
-
return create_reconciled_additional_senior_standard_deduction()
|
|
127
|
-
|
|
128
|
-
p = (
|
|
129
|
-
parameters.gov.contrib.reconciliation.additional_senior_standard_deduction
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
reform_active = False
|
|
133
|
-
current_period = period_(period)
|
|
134
|
-
|
|
135
|
-
for i in range(5):
|
|
136
|
-
if p(current_period).in_effect:
|
|
137
|
-
reform_active = True
|
|
138
|
-
break
|
|
139
|
-
current_period = current_period.offset(1, "year")
|
|
140
|
-
|
|
141
|
-
if reform_active:
|
|
142
|
-
return create_reconciled_additional_senior_standard_deduction()
|
|
143
|
-
else:
|
|
144
|
-
return None
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
reconciled_additional_senior_standard_deduction = (
|
|
148
|
-
create_reconciled_additional_senior_standard_deduction_reform(
|
|
149
|
-
None, None, bypass=True
|
|
150
|
-
)
|
|
151
|
-
)
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
from policyengine_us.model_api import *
|
|
2
|
-
from policyengine_core.periods import period as period_
|
|
3
|
-
from policyengine_core.periods import instant
|
|
4
|
-
import numpy as np
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def create_reconciled_auto_loan_interest_ald() -> Reform:
|
|
8
|
-
class auto_loan_interest_ald(Variable):
|
|
9
|
-
value_type = float
|
|
10
|
-
entity = TaxUnit
|
|
11
|
-
label = "Auto loan interest ALD"
|
|
12
|
-
unit = USD
|
|
13
|
-
definition_period = YEAR
|
|
14
|
-
reference = "https://budget.house.gov/imo/media/doc/one_big_beautiful_bill_act_-_full_bill_text.pdf#page=765"
|
|
15
|
-
|
|
16
|
-
def formula(tax_unit, period, parameters):
|
|
17
|
-
auto_loan_interest = add(tax_unit, period, ["auto_loan_interest"])
|
|
18
|
-
p = parameters(
|
|
19
|
-
period
|
|
20
|
-
).gov.contrib.reconciliation.auto_loan_interest_ald
|
|
21
|
-
capped_interest = min_(auto_loan_interest, p.cap)
|
|
22
|
-
# Get filing status.
|
|
23
|
-
filing_status = tax_unit("filing_status", period)
|
|
24
|
-
|
|
25
|
-
# Get the phaseout start amount based on filing status (line 4).
|
|
26
|
-
phaseout_start = p.phase_out.start[filing_status]
|
|
27
|
-
agi_pre_ald = tax_unit(
|
|
28
|
-
"adjusted_gross_income_pre_auto_loan_interest_ald", period
|
|
29
|
-
)
|
|
30
|
-
# Get the excess amount, if any, in thousands of dollars (rounded up) [lines 5 and 6].
|
|
31
|
-
excess = max_(agi_pre_ald - phaseout_start, 0)
|
|
32
|
-
increments = np.ceil(excess / p.phase_out.increment)
|
|
33
|
-
|
|
34
|
-
# Calculate the excess part phase out amount (line 7).
|
|
35
|
-
phase_out_amount = increments * p.phase_out.step
|
|
36
|
-
return max_(capped_interest - phase_out_amount, 0)
|
|
37
|
-
|
|
38
|
-
class adjusted_gross_income_pre_auto_loan_interest_ald(Variable):
|
|
39
|
-
value_type = float
|
|
40
|
-
entity = TaxUnit
|
|
41
|
-
label = "Adjusted gross income before the Auto Loan Interest ALD"
|
|
42
|
-
unit = USD
|
|
43
|
-
definition_period = YEAR
|
|
44
|
-
reference = "https://budget.house.gov/imo/media/doc/one_big_beautiful_bill_act_-_full_bill_text.pdf#page=765"
|
|
45
|
-
|
|
46
|
-
# OBBBA phases out the auto loan interest ALD with respect to AGI.
|
|
47
|
-
# This creates a circular reference, since it also reduces AGI.
|
|
48
|
-
# To get around this drafting error, we phase out the auto loan interest ALD
|
|
49
|
-
# with respect to a version of AGI that excludes the auto loan interest ALD.
|
|
50
|
-
def formula(tax_unit, period, parameters):
|
|
51
|
-
gross_income = add(tax_unit, period, ["irs_gross_income"])
|
|
52
|
-
above_the_line_deductions = tax_unit(
|
|
53
|
-
"above_the_line_deductions", period
|
|
54
|
-
)
|
|
55
|
-
agi = gross_income - above_the_line_deductions
|
|
56
|
-
if parameters(period).gov.contrib.ubi_center.basic_income.taxable:
|
|
57
|
-
agi += add(tax_unit, period, ["basic_income"])
|
|
58
|
-
return agi
|
|
59
|
-
|
|
60
|
-
class adjusted_gross_income(Variable):
|
|
61
|
-
value_type = float
|
|
62
|
-
entity = TaxUnit
|
|
63
|
-
label = "Adjusted gross income"
|
|
64
|
-
unit = USD
|
|
65
|
-
definition_period = YEAR
|
|
66
|
-
reference = "https://www.law.cornell.edu/uscode/text/26/62"
|
|
67
|
-
|
|
68
|
-
def formula(tax_unit, period, parameters):
|
|
69
|
-
gross_income = add(tax_unit, period, ["irs_gross_income"])
|
|
70
|
-
above_the_line_deductions = tax_unit(
|
|
71
|
-
"above_the_line_deductions", period
|
|
72
|
-
)
|
|
73
|
-
auto_loan_interest_ald = tax_unit("auto_loan_interest_ald", period)
|
|
74
|
-
agi = gross_income - (
|
|
75
|
-
above_the_line_deductions + auto_loan_interest_ald
|
|
76
|
-
)
|
|
77
|
-
p = parameters(
|
|
78
|
-
period
|
|
79
|
-
).gov.contrib.reconciliation.auto_loan_interest_ald
|
|
80
|
-
if p.senate_version.applies:
|
|
81
|
-
agi = gross_income - above_the_line_deductions
|
|
82
|
-
if parameters(period).gov.contrib.ubi_center.basic_income.taxable:
|
|
83
|
-
agi += add(tax_unit, period, ["basic_income"])
|
|
84
|
-
return agi
|
|
85
|
-
|
|
86
|
-
class taxable_income_deductions(Variable):
|
|
87
|
-
value_type = float
|
|
88
|
-
entity = TaxUnit
|
|
89
|
-
label = "Taxable income deductions"
|
|
90
|
-
unit = USD
|
|
91
|
-
definition_period = YEAR
|
|
92
|
-
|
|
93
|
-
def formula(tax_unit, period, parameters):
|
|
94
|
-
itemizes = tax_unit("tax_unit_itemizes", period)
|
|
95
|
-
deductions_if_itemizing = tax_unit(
|
|
96
|
-
"taxable_income_deductions_if_itemizing", period
|
|
97
|
-
)
|
|
98
|
-
deductions_if_not_itemizing = tax_unit(
|
|
99
|
-
"taxable_income_deductions_if_not_itemizing", period
|
|
100
|
-
)
|
|
101
|
-
auto_loan_interest_ald = tax_unit("auto_loan_interest_ald", period)
|
|
102
|
-
p = parameters(
|
|
103
|
-
period
|
|
104
|
-
).gov.contrib.reconciliation.auto_loan_interest_ald
|
|
105
|
-
if p.senate_version.applies:
|
|
106
|
-
deductions_if_itemizing = (
|
|
107
|
-
deductions_if_itemizing + auto_loan_interest_ald
|
|
108
|
-
)
|
|
109
|
-
deductions_if_not_itemizing = (
|
|
110
|
-
deductions_if_not_itemizing + auto_loan_interest_ald
|
|
111
|
-
)
|
|
112
|
-
return where(
|
|
113
|
-
itemizes, deductions_if_itemizing, deductions_if_not_itemizing
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
class reform(Reform):
|
|
117
|
-
def apply(self):
|
|
118
|
-
self.update_variable(auto_loan_interest_ald)
|
|
119
|
-
self.update_variable(adjusted_gross_income)
|
|
120
|
-
self.update_variable(
|
|
121
|
-
adjusted_gross_income_pre_auto_loan_interest_ald
|
|
122
|
-
)
|
|
123
|
-
self.update_variable(taxable_income_deductions)
|
|
124
|
-
|
|
125
|
-
return reform
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def create_reconciled_auto_loan_interest_ald_reform(
|
|
129
|
-
parameters, period, bypass: bool = False
|
|
130
|
-
):
|
|
131
|
-
if bypass:
|
|
132
|
-
return create_reconciled_auto_loan_interest_ald()
|
|
133
|
-
|
|
134
|
-
p = parameters.gov.contrib.reconciliation.auto_loan_interest_ald
|
|
135
|
-
|
|
136
|
-
reform_active = False
|
|
137
|
-
current_period = period_(period)
|
|
138
|
-
|
|
139
|
-
for i in range(5):
|
|
140
|
-
if p(current_period).in_effect:
|
|
141
|
-
reform_active = True
|
|
142
|
-
break
|
|
143
|
-
current_period = current_period.offset(1, "year")
|
|
144
|
-
|
|
145
|
-
if reform_active:
|
|
146
|
-
return create_reconciled_auto_loan_interest_ald()
|
|
147
|
-
else:
|
|
148
|
-
return None
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
reconciled_auto_loan_interest_ald = (
|
|
152
|
-
create_reconciled_auto_loan_interest_ald_reform(None, None, bypass=True)
|
|
153
|
-
)
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
from policyengine_us.model_api import *
|
|
2
|
-
from policyengine_core.periods import period as period_
|
|
3
|
-
from policyengine_core.periods import instant
|
|
4
|
-
import numpy as np
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def create_reconciled_medicaid_work_requirement() -> Reform:
|
|
8
|
-
class medicaid_work_requirement_eligible(Variable):
|
|
9
|
-
value_type = bool
|
|
10
|
-
entity = Person
|
|
11
|
-
label = "Eligible person for Medicaid via work requirement"
|
|
12
|
-
definition_period = YEAR
|
|
13
|
-
reference = (
|
|
14
|
-
"https://www.budget.senate.gov/imo/media/doc/the_one_big_beautiful_bill_act.pdf=678",
|
|
15
|
-
"https://budget.house.gov/imo/media/doc/one_big_beautiful_bill_act_-_full_bill_text.pdf#page=364",
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
def formula(person, period, parameters):
|
|
19
|
-
p = parameters(
|
|
20
|
-
period
|
|
21
|
-
).gov.contrib.reconciliation.medicaid_work_requirement
|
|
22
|
-
# Works no less than 80 hours p.680 (2)(A)
|
|
23
|
-
monthly_hours_worked = person("monthly_hours_worked", period)
|
|
24
|
-
meets_monthly_work_hours = (
|
|
25
|
-
monthly_hours_worked >= p.monthly_hours_threshold
|
|
26
|
-
)
|
|
27
|
-
# The individual is enrolled in an educational program at least half-time. p.680 (2)(D)
|
|
28
|
-
is_full_time_student = person("is_full_time_student", period)
|
|
29
|
-
# pregnant or postpartum medical assistance p.681 (3)(A)(i)(II)(bb)
|
|
30
|
-
is_pregnant = person("is_pregnant", period)
|
|
31
|
-
# Has attained age of 19 and is under 65 is require to work p.693 (bb)
|
|
32
|
-
age = person("age", period)
|
|
33
|
-
work_required_age = p.age_range.calc(age)
|
|
34
|
-
# parent, guardian, caretaker of a disabled person
|
|
35
|
-
is_dependent = person("is_tax_unit_dependent", period)
|
|
36
|
-
is_disabled = person("is_disabled", period)
|
|
37
|
-
has_disabled = person.tax_unit.any(is_dependent & is_disabled)
|
|
38
|
-
# veteran and is_permanently_and_totally_disabled p.694 (IV)
|
|
39
|
-
is_veteran = person("is_veteran", period)
|
|
40
|
-
is_permanently_and_totally_disabled = person(
|
|
41
|
-
"is_permanently_and_totally_disabled", period
|
|
42
|
-
)
|
|
43
|
-
eligible_veteran = is_veteran & is_permanently_and_totally_disabled
|
|
44
|
-
# blind or disabled or is_incapable_of_self_care p.694 (V)
|
|
45
|
-
is_blind = person("is_blind", period)
|
|
46
|
-
is_incapable_of_self_care = person(
|
|
47
|
-
"is_incapable_of_self_care", period
|
|
48
|
-
)
|
|
49
|
-
eligible_disabled = (
|
|
50
|
-
is_blind | is_disabled | is_incapable_of_self_care
|
|
51
|
-
)
|
|
52
|
-
# House Version
|
|
53
|
-
# parent, guardian, caretaker of a dependent child p.377 (III)
|
|
54
|
-
# https://budget.house.gov/imo/media/doc/one_big_beautiful_bill_act_-_full_bill_text.pdf#page=377
|
|
55
|
-
is_child = person("is_child", period)
|
|
56
|
-
has_dependent_child_house = person.tax_unit.any(
|
|
57
|
-
is_dependent & is_child
|
|
58
|
-
)
|
|
59
|
-
# Senate Version
|
|
60
|
-
# parent, guardian, caretaker of a dependent child 13 years of age or under p.694 (III)
|
|
61
|
-
child_age_eligible = age <= p.senate.dependent_age_limit
|
|
62
|
-
has_dependent_child_senate = person.tax_unit.any(
|
|
63
|
-
is_dependent & child_age_eligible
|
|
64
|
-
)
|
|
65
|
-
exempted_from_work = (
|
|
66
|
-
is_full_time_student
|
|
67
|
-
| is_pregnant
|
|
68
|
-
| has_disabled
|
|
69
|
-
| eligible_veteran
|
|
70
|
-
| eligible_disabled
|
|
71
|
-
)
|
|
72
|
-
meets_base_requirement = (
|
|
73
|
-
meets_monthly_work_hours | exempted_from_work
|
|
74
|
-
)
|
|
75
|
-
meets_senate_condition = (
|
|
76
|
-
meets_base_requirement | has_dependent_child_senate
|
|
77
|
-
)
|
|
78
|
-
meets_house_condition = (
|
|
79
|
-
meets_base_requirement | has_dependent_child_house
|
|
80
|
-
)
|
|
81
|
-
if p.senate.in_effect:
|
|
82
|
-
return where(work_required_age, meets_senate_condition, True)
|
|
83
|
-
elif p.house.in_effect:
|
|
84
|
-
return where(work_required_age, meets_house_condition, True)
|
|
85
|
-
else:
|
|
86
|
-
return True
|
|
87
|
-
|
|
88
|
-
class is_medicaid_eligible(Variable):
|
|
89
|
-
value_type = bool
|
|
90
|
-
entity = Person
|
|
91
|
-
label = "Eligible for Medicaid"
|
|
92
|
-
definition_period = YEAR
|
|
93
|
-
reference = (
|
|
94
|
-
"https://www.law.cornell.edu/uscode/text/42/1396a#a_10"
|
|
95
|
-
"https://www.kff.org/racial-equity-and-health-policy/fact-sheet/key-facts-on-health-coverage-of-immigrants"
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
def formula(person, period, parameters):
|
|
99
|
-
category = person("medicaid_category", period)
|
|
100
|
-
categorically_eligible = category != category.possible_values.NONE
|
|
101
|
-
istatus = person("immigration_status", period)
|
|
102
|
-
undocumented = istatus == istatus.possible_values.UNDOCUMENTED
|
|
103
|
-
state = person.household("state_code_str", period)
|
|
104
|
-
p = parameters(period).gov.hhs.medicaid.eligibility
|
|
105
|
-
state_covers_undocumented = p.undocumented_immigrant[state].astype(
|
|
106
|
-
bool
|
|
107
|
-
)
|
|
108
|
-
immigration_status_eligible = (
|
|
109
|
-
~undocumented | undocumented & state_covers_undocumented
|
|
110
|
-
)
|
|
111
|
-
work_requirement_eligible = person(
|
|
112
|
-
"medicaid_work_requirement_eligible", period
|
|
113
|
-
)
|
|
114
|
-
ca_ffyp_eligible = person("ca_ffyp_eligible", period)
|
|
115
|
-
return (
|
|
116
|
-
categorically_eligible
|
|
117
|
-
& immigration_status_eligible
|
|
118
|
-
& work_requirement_eligible
|
|
119
|
-
) | ca_ffyp_eligible
|
|
120
|
-
|
|
121
|
-
class reform(Reform):
|
|
122
|
-
def apply(self):
|
|
123
|
-
self.update_variable(medicaid_work_requirement_eligible)
|
|
124
|
-
self.update_variable(is_medicaid_eligible)
|
|
125
|
-
|
|
126
|
-
return reform
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
def create_reconciled_medicaid_work_requirement_reform(
|
|
130
|
-
parameters, period, bypass: bool = False
|
|
131
|
-
):
|
|
132
|
-
if bypass:
|
|
133
|
-
return create_reconciled_medicaid_work_requirement()
|
|
134
|
-
|
|
135
|
-
p = parameters.gov.contrib.reconciliation.medicaid_work_requirement
|
|
136
|
-
|
|
137
|
-
reform_active = False
|
|
138
|
-
current_period = period_(period)
|
|
139
|
-
|
|
140
|
-
for i in range(5):
|
|
141
|
-
if (
|
|
142
|
-
p(current_period).house.in_effect
|
|
143
|
-
or p(current_period).senate.in_effect
|
|
144
|
-
):
|
|
145
|
-
reform_active = True
|
|
146
|
-
break
|
|
147
|
-
current_period = current_period.offset(1, "year")
|
|
148
|
-
|
|
149
|
-
if reform_active:
|
|
150
|
-
return create_reconciled_medicaid_work_requirement()
|
|
151
|
-
else:
|
|
152
|
-
return None
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
reconciled_medicaid_work_requirement = (
|
|
156
|
-
create_reconciled_medicaid_work_requirement_reform(None, None, bypass=True)
|
|
157
|
-
)
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
from policyengine_us.model_api import *
|
|
2
|
-
from policyengine_core.periods import period as period_
|
|
3
|
-
from policyengine_core.periods import instant
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def create_reconciled_pease() -> Reform:
|
|
7
|
-
class itemized_taxable_income_deductions_reduction(Variable):
|
|
8
|
-
value_type = float
|
|
9
|
-
entity = TaxUnit
|
|
10
|
-
label = "Itemized taxable income deductions reduction"
|
|
11
|
-
unit = USD
|
|
12
|
-
definition_period = YEAR
|
|
13
|
-
|
|
14
|
-
def formula(tax_unit, period, parameters):
|
|
15
|
-
p = parameters(period).gov.contrib.reconciliation.pease
|
|
16
|
-
if p.in_effect:
|
|
17
|
-
filing_status = tax_unit("filing_status", period)
|
|
18
|
-
top_rate_threshold = parameters(
|
|
19
|
-
period
|
|
20
|
-
).gov.irs.income.bracket.thresholds["6"][filing_status]
|
|
21
|
-
agi = tax_unit("adjusted_gross_income", period)
|
|
22
|
-
exemptions = tax_unit("exemptions", period)
|
|
23
|
-
taxable_income = max_(0, agi - exemptions)
|
|
24
|
-
taxable_income_excess = max_(
|
|
25
|
-
0, taxable_income - top_rate_threshold
|
|
26
|
-
)
|
|
27
|
-
total_itemized_deductions = tax_unit(
|
|
28
|
-
"total_itemized_taxable_income_deductions", period
|
|
29
|
-
)
|
|
30
|
-
lesser_of_deductions_or_excess = min_(
|
|
31
|
-
total_itemized_deductions, taxable_income_excess
|
|
32
|
-
)
|
|
33
|
-
if p.amended_structure.in_effect:
|
|
34
|
-
salt_deduction = tax_unit("salt_deduction", period)
|
|
35
|
-
lesser_of_salt_or_excess = min_(
|
|
36
|
-
salt_deduction, taxable_income_excess
|
|
37
|
-
)
|
|
38
|
-
salt_deduction_reduction = (
|
|
39
|
-
p.amended_structure.salt_rate
|
|
40
|
-
* lesser_of_salt_or_excess
|
|
41
|
-
)
|
|
42
|
-
remaining_deductions = max_(
|
|
43
|
-
total_itemized_deductions - salt_deduction, 0
|
|
44
|
-
)
|
|
45
|
-
lesser_of_remaining_or_excess = min_(
|
|
46
|
-
remaining_deductions, taxable_income_excess
|
|
47
|
-
)
|
|
48
|
-
other_deductions_reduction = (
|
|
49
|
-
p.rate * lesser_of_remaining_or_excess
|
|
50
|
-
)
|
|
51
|
-
return (
|
|
52
|
-
salt_deduction_reduction + other_deductions_reduction
|
|
53
|
-
)
|
|
54
|
-
return p.rate * lesser_of_deductions_or_excess
|
|
55
|
-
return 0
|
|
56
|
-
|
|
57
|
-
class reform(Reform):
|
|
58
|
-
def apply(self):
|
|
59
|
-
self.update_variable(itemized_taxable_income_deductions_reduction)
|
|
60
|
-
|
|
61
|
-
return reform
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def create_reconciled_pease_reform(parameters, period, bypass: bool = False):
|
|
65
|
-
if bypass:
|
|
66
|
-
return create_reconciled_pease()
|
|
67
|
-
|
|
68
|
-
p = parameters.gov.contrib.reconciliation.pease
|
|
69
|
-
|
|
70
|
-
reform_active = False
|
|
71
|
-
current_period = period_(period)
|
|
72
|
-
|
|
73
|
-
for i in range(5):
|
|
74
|
-
if p(current_period).in_effect:
|
|
75
|
-
reform_active = True
|
|
76
|
-
break
|
|
77
|
-
current_period = current_period.offset(1, "year")
|
|
78
|
-
|
|
79
|
-
if reform_active:
|
|
80
|
-
return create_reconciled_pease()
|
|
81
|
-
else:
|
|
82
|
-
return None
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
reconciled_pease = create_reconciled_pease_reform(None, None, bypass=True)
|