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,78 +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_qbid() -> Reform:
|
|
7
|
-
class qbid_amount(Variable):
|
|
8
|
-
value_type = float
|
|
9
|
-
entity = Person
|
|
10
|
-
label = "Per‑cap qualified business income deduction amount for each person"
|
|
11
|
-
unit = USD
|
|
12
|
-
definition_period = YEAR
|
|
13
|
-
reference = (
|
|
14
|
-
"https://www.law.cornell.edu/uscode/text/26/199A#b_1"
|
|
15
|
-
"https://www.irs.gov/pub/irs-prior/p535--2018.pdf"
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
def formula(person, period, parameters):
|
|
19
|
-
p = parameters(period).gov.irs.deductions
|
|
20
|
-
|
|
21
|
-
# 1. Compute the new maximum QBID
|
|
22
|
-
qbi = person("qualified_business_income", period)
|
|
23
|
-
qbid_max = p.qbi.max.rate * qbi
|
|
24
|
-
|
|
25
|
-
# 2. Compute the wage/property cap (unchanged)
|
|
26
|
-
w2_wages = person("w2_wages_from_qualified_business", period)
|
|
27
|
-
b_property = person("unadjusted_basis_qualified_property", period)
|
|
28
|
-
wage_cap = w2_wages * p.qbi.max.w2_wages.rate
|
|
29
|
-
alt_cap = (
|
|
30
|
-
w2_wages * p.qbi.max.w2_wages.alt_rate
|
|
31
|
-
+ b_property * p.qbi.max.business_property.rate
|
|
32
|
-
)
|
|
33
|
-
full_cap = max_(wage_cap, alt_cap)
|
|
34
|
-
|
|
35
|
-
# 3. Phase‑out logic: 75% of each dollar above the threshold
|
|
36
|
-
taxinc_less_qbid = person.tax_unit(
|
|
37
|
-
"taxable_income_less_qbid", period
|
|
38
|
-
)
|
|
39
|
-
filing_status = person.tax_unit("filing_status", period)
|
|
40
|
-
threshold = p.qbi.phase_out.start[filing_status]
|
|
41
|
-
p_ref = parameters(period).gov.contrib.reconciliation.qbid
|
|
42
|
-
phase_out_rate = p_ref.phase_out_rate
|
|
43
|
-
excess_income = max_(0, taxinc_less_qbid - threshold)
|
|
44
|
-
reduction_amount = phase_out_rate * excess_income
|
|
45
|
-
# 4. Apply phase‑out to the 22% deduction
|
|
46
|
-
phased_deduction = max_(0, qbid_max - reduction_amount)
|
|
47
|
-
# 5. Final QBID is the lesser of the phased deduction or the wage/property cap
|
|
48
|
-
return min_(phased_deduction, full_cap)
|
|
49
|
-
|
|
50
|
-
class reform(Reform):
|
|
51
|
-
def apply(self):
|
|
52
|
-
self.update_variable(qbid_amount)
|
|
53
|
-
|
|
54
|
-
return reform
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def create_reconciled_qbid_reform(parameters, period, bypass: bool = False):
|
|
58
|
-
if bypass:
|
|
59
|
-
return create_reconciled_qbid()
|
|
60
|
-
|
|
61
|
-
p = parameters.gov.contrib.reconciliation.qbid
|
|
62
|
-
|
|
63
|
-
reform_active = False
|
|
64
|
-
current_period = period_(period)
|
|
65
|
-
|
|
66
|
-
for i in range(5):
|
|
67
|
-
if p(current_period).in_effect:
|
|
68
|
-
reform_active = True
|
|
69
|
-
break
|
|
70
|
-
current_period = current_period.offset(1, "year")
|
|
71
|
-
|
|
72
|
-
if reform_active:
|
|
73
|
-
return create_reconciled_qbid()
|
|
74
|
-
else:
|
|
75
|
-
return None
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
reconciled_qbid = create_reconciled_qbid_reform(None, None, bypass=True)
|
|
@@ -1,125 +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_snap_abawd_work_requirement() -> Reform:
|
|
7
|
-
class meets_snap_abawd_work_requirements(Variable):
|
|
8
|
-
value_type = bool
|
|
9
|
-
entity = Person
|
|
10
|
-
label = "Person is eligible for SNAP benefits via Able-Bodied Adult Without Dependents (ABAWD) work requirements"
|
|
11
|
-
definition_period = MONTH
|
|
12
|
-
reference = "https://agriculture.house.gov/uploadedfiles/ag-recon-combo_03_xml.pdf#page=4"
|
|
13
|
-
|
|
14
|
-
def formula(person, period, parameters):
|
|
15
|
-
p = parameters(period).gov.usda.snap.work_requirements.abawd
|
|
16
|
-
age = person("monthly_age", period)
|
|
17
|
-
weekly_hours_worked = person(
|
|
18
|
-
"weekly_hours_worked", period.this_year
|
|
19
|
-
)
|
|
20
|
-
# Work at least 20 hours a week
|
|
21
|
-
is_working = weekly_hours_worked >= p.weekly_hours_threshold
|
|
22
|
-
# Under 18 or 65 years of age or older are exempted (baseline is 18 or 65) (A)
|
|
23
|
-
worked_exempted_age = p.age_threshold.exempted.calc(age)
|
|
24
|
-
# Unable to work due to a physical or mental limitation (B)
|
|
25
|
-
is_disabled = person("is_disabled", period)
|
|
26
|
-
# Parent of a household member under 7 (baseline is 18) (C)
|
|
27
|
-
is_dependent = person("is_tax_unit_dependent", period)
|
|
28
|
-
is_qualifying_child = age < p.age_threshold.dependent
|
|
29
|
-
is_parent = person("is_parent", period)
|
|
30
|
-
has_child = person.spm_unit.any(is_dependent & is_qualifying_child)
|
|
31
|
-
exempted_parent = is_parent & has_child
|
|
32
|
-
# Exempted from the general work requirements (D)
|
|
33
|
-
meets_snap_general_work_requirements = person(
|
|
34
|
-
"meets_snap_general_work_requirements", period
|
|
35
|
-
)
|
|
36
|
-
# Pregnant (E)
|
|
37
|
-
is_pregnant = person("is_pregnant", period)
|
|
38
|
-
# Homeless (remove in 2030) (F)
|
|
39
|
-
is_homeless = person.household("is_homeless", period)
|
|
40
|
-
# A veteran (remove in 2030) (G)
|
|
41
|
-
is_veteran = person("is_veteran", period)
|
|
42
|
-
# Responsible for a child 7 or older, and is married to individual who is working (I)
|
|
43
|
-
is_child = person("is_child", period)
|
|
44
|
-
older_child_dependent = (
|
|
45
|
-
is_dependent & is_child & ~is_qualifying_child
|
|
46
|
-
)
|
|
47
|
-
is_married = person.family("is_married", period)
|
|
48
|
-
has_older_child_dependent = person.spm_unit.any(
|
|
49
|
-
older_child_dependent
|
|
50
|
-
)
|
|
51
|
-
is_head_or_spouse = person("is_tax_unit_head_or_spouse", period)
|
|
52
|
-
has_head_or_spouse_working = person.spm_unit.any(
|
|
53
|
-
is_head_or_spouse & is_working
|
|
54
|
-
)
|
|
55
|
-
exempted_married_person = where(
|
|
56
|
-
is_married & has_older_child_dependent,
|
|
57
|
-
has_head_or_spouse_working,
|
|
58
|
-
0,
|
|
59
|
-
)
|
|
60
|
-
# Sunset provision effects on 2030-10-01
|
|
61
|
-
p_reform = parameters(
|
|
62
|
-
period
|
|
63
|
-
).gov.contrib.reconciliation.snap_abawd_work_requirement
|
|
64
|
-
base_conditions = (
|
|
65
|
-
is_working
|
|
66
|
-
| worked_exempted_age
|
|
67
|
-
| is_disabled
|
|
68
|
-
| exempted_parent
|
|
69
|
-
| meets_snap_general_work_requirements
|
|
70
|
-
| is_pregnant
|
|
71
|
-
| exempted_married_person
|
|
72
|
-
)
|
|
73
|
-
if p_reform.sunset_provision_in_effect:
|
|
74
|
-
return base_conditions
|
|
75
|
-
return base_conditions | is_homeless | is_veteran
|
|
76
|
-
|
|
77
|
-
def modify_parameters(parameters):
|
|
78
|
-
parameters.gov.usda.snap.work_requirements.abawd.age_threshold.dependent.update(
|
|
79
|
-
start=instant("2027-01-01"), stop=instant("2035-12-31"), value=7
|
|
80
|
-
)
|
|
81
|
-
parameters.gov.usda.snap.work_requirements.abawd.age_threshold.exempted[
|
|
82
|
-
2
|
|
83
|
-
].threshold.update(
|
|
84
|
-
start=instant("2027-01-01"),
|
|
85
|
-
stop=instant("2035-12-31"),
|
|
86
|
-
value=65,
|
|
87
|
-
)
|
|
88
|
-
return parameters
|
|
89
|
-
|
|
90
|
-
class reform(Reform):
|
|
91
|
-
def apply(self):
|
|
92
|
-
self.update_variable(meets_snap_abawd_work_requirements)
|
|
93
|
-
self.modify_parameters(modify_parameters)
|
|
94
|
-
|
|
95
|
-
return reform
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
def create_reconciled_snap_abawd_work_requirement_reform(
|
|
99
|
-
parameters, period, bypass: bool = False
|
|
100
|
-
):
|
|
101
|
-
if bypass:
|
|
102
|
-
return create_reconciled_snap_abawd_work_requirement()
|
|
103
|
-
|
|
104
|
-
p = parameters.gov.contrib.reconciliation.snap_abawd_work_requirement
|
|
105
|
-
|
|
106
|
-
reform_active = False
|
|
107
|
-
current_period = period_(period)
|
|
108
|
-
|
|
109
|
-
for i in range(5):
|
|
110
|
-
if p(current_period).in_effect:
|
|
111
|
-
reform_active = True
|
|
112
|
-
break
|
|
113
|
-
current_period = current_period.offset(1, "year")
|
|
114
|
-
|
|
115
|
-
if reform_active:
|
|
116
|
-
return create_reconciled_snap_abawd_work_requirement()
|
|
117
|
-
else:
|
|
118
|
-
return None
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
reconciled_snap_abawd_work_requirement = (
|
|
122
|
-
create_reconciled_snap_abawd_work_requirement_reform(
|
|
123
|
-
None, None, bypass=True
|
|
124
|
-
)
|
|
125
|
-
)
|
|
@@ -1,177 +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_tip_and_overtime_exempt() -> Reform:
|
|
7
|
-
class tip_income_deduction(Variable):
|
|
8
|
-
value_type = float
|
|
9
|
-
entity = TaxUnit
|
|
10
|
-
label = "Tip income deduction"
|
|
11
|
-
unit = USD
|
|
12
|
-
definition_period = YEAR
|
|
13
|
-
|
|
14
|
-
def formula(tax_unit, period, parameters):
|
|
15
|
-
p = parameters(period).gov.contrib.reconciliation.tip_income_exempt
|
|
16
|
-
if p.in_effect:
|
|
17
|
-
person = tax_unit.members
|
|
18
|
-
ssn_card_type = person("ssn_card_type", period)
|
|
19
|
-
ssn_card_types = ssn_card_type.possible_values
|
|
20
|
-
citizen = ssn_card_type == ssn_card_types.CITIZEN
|
|
21
|
-
non_citizen_valid_ead = (
|
|
22
|
-
ssn_card_type == ssn_card_types.NON_CITIZEN_VALID_EAD
|
|
23
|
-
)
|
|
24
|
-
eligible_ssn_card_type = citizen | non_citizen_valid_ead
|
|
25
|
-
head = person("is_tax_unit_head", period)
|
|
26
|
-
spouse = person("is_tax_unit_spouse", period)
|
|
27
|
-
ineligible_head_exists = tax_unit.any(
|
|
28
|
-
head & ~eligible_ssn_card_type
|
|
29
|
-
)
|
|
30
|
-
ineligible_spouse_exists = tax_unit.any(
|
|
31
|
-
spouse & ~eligible_ssn_card_type
|
|
32
|
-
)
|
|
33
|
-
ineligible_cardholder_present = (
|
|
34
|
-
ineligible_head_exists | ineligible_spouse_exists
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
tip_income = person("tip_income", period)
|
|
38
|
-
if p.phase_out.applies:
|
|
39
|
-
agi = tax_unit("adjusted_gross_income", period)
|
|
40
|
-
filing_status = tax_unit("filing_status", period)
|
|
41
|
-
cap = p.cap[filing_status]
|
|
42
|
-
start = p.phase_out.start[filing_status]
|
|
43
|
-
agi_excess = max_(agi - start, 0)
|
|
44
|
-
phase_out_amount = agi_excess * p.phase_out.rate
|
|
45
|
-
total_tip_income = tax_unit.sum(tip_income)
|
|
46
|
-
capped_overtime_income = min_(cap, total_tip_income)
|
|
47
|
-
phased_out_overtime_income = max_(
|
|
48
|
-
0, capped_overtime_income - phase_out_amount
|
|
49
|
-
)
|
|
50
|
-
return (
|
|
51
|
-
phased_out_overtime_income
|
|
52
|
-
* ~ineligible_cardholder_present
|
|
53
|
-
)
|
|
54
|
-
eligible_ssn_card_holder = eligible_ssn_card_type & (
|
|
55
|
-
head | spouse
|
|
56
|
-
)
|
|
57
|
-
return tax_unit.sum(tip_income * eligible_ssn_card_holder)
|
|
58
|
-
return 0
|
|
59
|
-
|
|
60
|
-
class overtime_income_deduction(Variable):
|
|
61
|
-
value_type = float
|
|
62
|
-
entity = TaxUnit
|
|
63
|
-
label = "Overtime income deduction"
|
|
64
|
-
unit = USD
|
|
65
|
-
definition_period = YEAR
|
|
66
|
-
|
|
67
|
-
def formula(tax_unit, period, parameters):
|
|
68
|
-
p = parameters(
|
|
69
|
-
period
|
|
70
|
-
).gov.contrib.reconciliation.overtime_income_exempt
|
|
71
|
-
if p.in_effect:
|
|
72
|
-
person = tax_unit.members
|
|
73
|
-
ssn_card_type = person("ssn_card_type", period)
|
|
74
|
-
ssn_card_types = ssn_card_type.possible_values
|
|
75
|
-
citizen = ssn_card_type == ssn_card_types.CITIZEN
|
|
76
|
-
non_citizen_valid_ead = (
|
|
77
|
-
ssn_card_type == ssn_card_types.NON_CITIZEN_VALID_EAD
|
|
78
|
-
)
|
|
79
|
-
eligible_ssn_card_type = citizen | non_citizen_valid_ead
|
|
80
|
-
head = person("is_tax_unit_head", period)
|
|
81
|
-
spouse = person("is_tax_unit_spouse", period)
|
|
82
|
-
ineligible_head_exists = tax_unit.any(
|
|
83
|
-
head & ~eligible_ssn_card_type
|
|
84
|
-
)
|
|
85
|
-
ineligible_spouse_exists = tax_unit.any(
|
|
86
|
-
spouse & ~eligible_ssn_card_type
|
|
87
|
-
)
|
|
88
|
-
ineligible_cardholder_present = (
|
|
89
|
-
ineligible_head_exists | ineligible_spouse_exists
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
overtime_income = person("fsla_overtime_premium", period)
|
|
93
|
-
if p.phase_out.applies:
|
|
94
|
-
agi = tax_unit("adjusted_gross_income", period)
|
|
95
|
-
filing_status = tax_unit("filing_status", period)
|
|
96
|
-
cap = p.cap[filing_status]
|
|
97
|
-
start = p.phase_out.start[filing_status]
|
|
98
|
-
agi_excess = max_(agi - start, 0)
|
|
99
|
-
phase_out_amount = agi_excess * p.phase_out.rate
|
|
100
|
-
total_overtime_income = tax_unit.sum(overtime_income)
|
|
101
|
-
capped_overtime_income = min_(cap, total_overtime_income)
|
|
102
|
-
phased_out_overtime_income = max_(
|
|
103
|
-
0, capped_overtime_income - phase_out_amount
|
|
104
|
-
)
|
|
105
|
-
return (
|
|
106
|
-
phased_out_overtime_income
|
|
107
|
-
* ~ineligible_cardholder_present
|
|
108
|
-
)
|
|
109
|
-
eligible_ssn_card_holder = eligible_ssn_card_type & (
|
|
110
|
-
head | spouse
|
|
111
|
-
)
|
|
112
|
-
return tax_unit.sum(overtime_income * eligible_ssn_card_holder)
|
|
113
|
-
return 0
|
|
114
|
-
|
|
115
|
-
def modify_parameters(parameters):
|
|
116
|
-
parameters.gov.irs.deductions.deductions_if_itemizing.update(
|
|
117
|
-
start=instant("2026-01-01"),
|
|
118
|
-
stop=instant("2035-12-31"),
|
|
119
|
-
value=[
|
|
120
|
-
"tip_income_deduction",
|
|
121
|
-
"overtime_income_deduction",
|
|
122
|
-
"itemized_taxable_income_deductions",
|
|
123
|
-
"qualified_business_income_deduction",
|
|
124
|
-
"wagering_losses_deduction",
|
|
125
|
-
],
|
|
126
|
-
)
|
|
127
|
-
parameters.gov.irs.deductions.deductions_if_not_itemizing.update(
|
|
128
|
-
start=instant("2026-01-01"),
|
|
129
|
-
stop=instant("2035-12-31"),
|
|
130
|
-
value=[
|
|
131
|
-
"tip_income_deduction",
|
|
132
|
-
"overtime_income_deduction",
|
|
133
|
-
"charitable_deduction_for_non_itemizers",
|
|
134
|
-
"standard_deduction",
|
|
135
|
-
"qualified_business_income_deduction",
|
|
136
|
-
],
|
|
137
|
-
)
|
|
138
|
-
return parameters
|
|
139
|
-
|
|
140
|
-
class reform(Reform):
|
|
141
|
-
def apply(self):
|
|
142
|
-
self.update_variable(tip_income_deduction)
|
|
143
|
-
self.update_variable(overtime_income_deduction)
|
|
144
|
-
self.modify_parameters(modify_parameters)
|
|
145
|
-
|
|
146
|
-
return reform
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
def create_reconciled_tip_and_overtime_exempt_reform(
|
|
150
|
-
parameters, period, bypass: bool = False
|
|
151
|
-
):
|
|
152
|
-
if bypass:
|
|
153
|
-
return create_reconciled_tip_and_overtime_exempt()
|
|
154
|
-
|
|
155
|
-
p = parameters.gov.contrib.reconciliation
|
|
156
|
-
|
|
157
|
-
reform_active = False
|
|
158
|
-
current_period = period_(period)
|
|
159
|
-
|
|
160
|
-
for i in range(5):
|
|
161
|
-
if (
|
|
162
|
-
p(current_period).tip_income_exempt.in_effect
|
|
163
|
-
or p(current_period).overtime_income_exempt.in_effect
|
|
164
|
-
):
|
|
165
|
-
reform_active = True
|
|
166
|
-
break
|
|
167
|
-
current_period = current_period.offset(1, "year")
|
|
168
|
-
|
|
169
|
-
if reform_active:
|
|
170
|
-
return create_reconciled_tip_and_overtime_exempt()
|
|
171
|
-
else:
|
|
172
|
-
return None
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
reconciled_tip_and_overtime_exempt = (
|
|
176
|
-
create_reconciled_tip_and_overtime_exempt_reform(None, None, bypass=True)
|
|
177
|
-
)
|
|
@@ -1,78 +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_reconciliation_cdcc() -> Reform:
|
|
7
|
-
class cdcc_rate(Variable):
|
|
8
|
-
value_type = float
|
|
9
|
-
entity = TaxUnit
|
|
10
|
-
label = "CDCC credit rate"
|
|
11
|
-
unit = USD
|
|
12
|
-
definition_period = YEAR
|
|
13
|
-
reference = "https://www.law.cornell.edu/uscode/text/26/21#a_2"
|
|
14
|
-
|
|
15
|
-
def formula(tax_unit, period, parameters):
|
|
16
|
-
p = parameters(period).gov.irs.credits.cdcc
|
|
17
|
-
agi = tax_unit("adjusted_gross_income", period)
|
|
18
|
-
|
|
19
|
-
# First phase-out
|
|
20
|
-
excess_agi = max_(0, agi - p.phase_out.start)
|
|
21
|
-
increments = np.ceil(excess_agi / p.phase_out.increment)
|
|
22
|
-
percentage_reduction = increments * p.phase_out.rate
|
|
23
|
-
phased_out_rate = max_(
|
|
24
|
-
p.phase_out.min, p.phase_out.max - percentage_reduction
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
# Second phase-out
|
|
28
|
-
p_ref = parameters(period).gov.contrib.reconciliation.cdcc
|
|
29
|
-
filing_status = tax_unit("filing_status", period)
|
|
30
|
-
second_phase_out_start = p_ref.phase_out.second_start[
|
|
31
|
-
filing_status
|
|
32
|
-
]
|
|
33
|
-
second_excess_agi = max_(0, agi - second_phase_out_start)
|
|
34
|
-
second_phase_out_increment = p_ref.phase_out.second_increment[
|
|
35
|
-
filing_status
|
|
36
|
-
]
|
|
37
|
-
second_increments = np.ceil(
|
|
38
|
-
second_excess_agi / second_phase_out_increment
|
|
39
|
-
)
|
|
40
|
-
second_percentage_reduction = second_increments * p.phase_out.rate
|
|
41
|
-
return max_(
|
|
42
|
-
p_ref.phase_out.second_min,
|
|
43
|
-
phased_out_rate - second_percentage_reduction,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
class reform(Reform):
|
|
47
|
-
def apply(self):
|
|
48
|
-
self.update_variable(cdcc_rate)
|
|
49
|
-
|
|
50
|
-
return reform
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def create_reconciliation_cdcc_reform(
|
|
54
|
-
parameters, period, bypass: bool = False
|
|
55
|
-
):
|
|
56
|
-
if bypass:
|
|
57
|
-
return create_reconciliation_cdcc()
|
|
58
|
-
|
|
59
|
-
p = parameters.gov.contrib.reconciliation.cdcc
|
|
60
|
-
|
|
61
|
-
reform_active = False
|
|
62
|
-
current_period = period_(period)
|
|
63
|
-
|
|
64
|
-
for i in range(5):
|
|
65
|
-
if p(current_period).in_effect:
|
|
66
|
-
reform_active = True
|
|
67
|
-
break
|
|
68
|
-
current_period = current_period.offset(1, "year")
|
|
69
|
-
|
|
70
|
-
if reform_active:
|
|
71
|
-
return create_reconciliation_cdcc()
|
|
72
|
-
else:
|
|
73
|
-
return None
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
reconciliation_cdcc = create_reconciliation_cdcc_reform(
|
|
77
|
-
None, None, bypass=True
|
|
78
|
-
)
|
|
@@ -1,78 +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_charitable_deduction() -> Reform:
|
|
8
|
-
class charitable_deduction(Variable):
|
|
9
|
-
value_type = float
|
|
10
|
-
entity = TaxUnit
|
|
11
|
-
label = "Charitable deduction"
|
|
12
|
-
unit = USD
|
|
13
|
-
documentation = (
|
|
14
|
-
"Deduction from taxable income for charitable donations."
|
|
15
|
-
)
|
|
16
|
-
definition_period = YEAR
|
|
17
|
-
reference = "https://www.law.cornell.edu/uscode/text/26/170"
|
|
18
|
-
|
|
19
|
-
def formula(tax_unit, period, parameters):
|
|
20
|
-
cash_donations = add(
|
|
21
|
-
tax_unit, period, ["charitable_cash_donations"]
|
|
22
|
-
)
|
|
23
|
-
non_cash_donations = add(
|
|
24
|
-
tax_unit, period, ["charitable_non_cash_donations"]
|
|
25
|
-
)
|
|
26
|
-
positive_agi = tax_unit("positive_agi", period)
|
|
27
|
-
p = parameters(period).gov.irs.deductions.itemized.charity.ceiling
|
|
28
|
-
p_ref = parameters(
|
|
29
|
-
period
|
|
30
|
-
).gov.contrib.reconciliation.charitable_donations
|
|
31
|
-
deduction_floor = p_ref.floor * positive_agi
|
|
32
|
-
reduced_non_cash_donations = max_(
|
|
33
|
-
non_cash_donations - deduction_floor, 0
|
|
34
|
-
)
|
|
35
|
-
capped_non_cash_donations = min_(
|
|
36
|
-
reduced_non_cash_donations, p.non_cash * positive_agi
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
total_cap = p.all * positive_agi
|
|
40
|
-
remaining_floor = max_(deduction_floor - non_cash_donations, 0)
|
|
41
|
-
reduced_cash_donations = max_(cash_donations - remaining_floor, 0)
|
|
42
|
-
return min_(
|
|
43
|
-
capped_non_cash_donations + reduced_cash_donations, total_cap
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
class reform(Reform):
|
|
47
|
-
def apply(self):
|
|
48
|
-
self.update_variable(charitable_deduction)
|
|
49
|
-
|
|
50
|
-
return reform
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def create_reconciled_charitable_deduction_reform(
|
|
54
|
-
parameters, period, bypass: bool = False
|
|
55
|
-
):
|
|
56
|
-
if bypass:
|
|
57
|
-
return create_reconciled_charitable_deduction()
|
|
58
|
-
|
|
59
|
-
p = parameters.gov.contrib.reconciliation.charitable_donations
|
|
60
|
-
|
|
61
|
-
reform_active = False
|
|
62
|
-
current_period = period_(period)
|
|
63
|
-
|
|
64
|
-
for i in range(5):
|
|
65
|
-
if p(current_period).in_effect:
|
|
66
|
-
reform_active = True
|
|
67
|
-
break
|
|
68
|
-
current_period = current_period.offset(1, "year")
|
|
69
|
-
|
|
70
|
-
if reform_active:
|
|
71
|
-
return create_reconciled_charitable_deduction()
|
|
72
|
-
else:
|
|
73
|
-
return None
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
reconciliation_charitable_deduction = (
|
|
77
|
-
create_reconciled_charitable_deduction_reform(None, None, bypass=True)
|
|
78
|
-
)
|
|
@@ -1,72 +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_reconciliation_qbid_with_floor() -> Reform:
|
|
7
|
-
class qualified_business_income_deduction(Variable):
|
|
8
|
-
value_type = float
|
|
9
|
-
entity = TaxUnit
|
|
10
|
-
label = "Qualified business income deduction for tax unit"
|
|
11
|
-
unit = USD
|
|
12
|
-
definition_period = YEAR
|
|
13
|
-
reference = (
|
|
14
|
-
"https://www.law.cornell.edu/uscode/text/26/199A#b_1"
|
|
15
|
-
"https://www.irs.gov/pub/irs-prior/p535--2018.pdf"
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
def formula(tax_unit, period, parameters):
|
|
19
|
-
# compute sum of QBID amounts for each person in TaxUnit following
|
|
20
|
-
# logic in 2018 IRS Publication 535, Worksheet 12-A, line 16
|
|
21
|
-
person = tax_unit.members
|
|
22
|
-
qbid_amt = person("qbid_amount", period)
|
|
23
|
-
uncapped_qbid = tax_unit.sum(qbid_amt)
|
|
24
|
-
# apply taxinc cap at the TaxUnit level following logic
|
|
25
|
-
# in 2018 IRS Publication 535, Worksheet 12-A, lines 32-37
|
|
26
|
-
taxinc_less_qbid = tax_unit("taxable_income_less_qbid", period)
|
|
27
|
-
netcg_qdiv = tax_unit("adjusted_net_capital_gain", period)
|
|
28
|
-
p = parameters(period).gov.irs.deductions.qbi.max
|
|
29
|
-
taxinc_cap = p.rate * max_(0, taxinc_less_qbid - netcg_qdiv)
|
|
30
|
-
pre_floor_qbid = min_(uncapped_qbid, taxinc_cap)
|
|
31
|
-
p_ref = parameters(
|
|
32
|
-
period
|
|
33
|
-
).gov.contrib.reconciliation.qbid.deduction_floor
|
|
34
|
-
qualified_business_income = tax_unit(
|
|
35
|
-
"qualified_business_income", period
|
|
36
|
-
)
|
|
37
|
-
floor = p_ref.amount.calc(qualified_business_income)
|
|
38
|
-
return max_(pre_floor_qbid, floor)
|
|
39
|
-
|
|
40
|
-
class reform(Reform):
|
|
41
|
-
def apply(self):
|
|
42
|
-
self.update_variable(qualified_business_income_deduction)
|
|
43
|
-
|
|
44
|
-
return reform
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def create_reconciliation_qbid_with_floor_reform(
|
|
48
|
-
parameters, period, bypass: bool = False
|
|
49
|
-
):
|
|
50
|
-
if bypass:
|
|
51
|
-
return create_reconciliation_qbid_with_floor()
|
|
52
|
-
|
|
53
|
-
p = parameters.gov.contrib.reconciliation.qbid.deduction_floor
|
|
54
|
-
|
|
55
|
-
reform_active = False
|
|
56
|
-
current_period = period_(period)
|
|
57
|
-
|
|
58
|
-
for i in range(5):
|
|
59
|
-
if p(current_period).in_effect:
|
|
60
|
-
reform_active = True
|
|
61
|
-
break
|
|
62
|
-
current_period = current_period.offset(1, "year")
|
|
63
|
-
|
|
64
|
-
if reform_active:
|
|
65
|
-
return create_reconciliation_qbid_with_floor()
|
|
66
|
-
else:
|
|
67
|
-
return None
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
reconciliation_qbid_with_floor = create_reconciliation_qbid_with_floor_reform(
|
|
71
|
-
None, None, bypass=True
|
|
72
|
-
)
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
from policyengine_us.model_api import *
|
|
2
|
-
from policyengine_core.periods import period as period_
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def create_salt_phase_out() -> Reform:
|
|
6
|
-
|
|
7
|
-
class salt_cap(Variable):
|
|
8
|
-
value_type = float
|
|
9
|
-
entity = TaxUnit
|
|
10
|
-
label = "SALT cap"
|
|
11
|
-
unit = USD
|
|
12
|
-
definition_period = YEAR
|
|
13
|
-
reference = "https://www.law.cornell.edu/uscode/text/26/164"
|
|
14
|
-
|
|
15
|
-
def formula(tax_unit, period, parameters):
|
|
16
|
-
filing_status = tax_unit("filing_status", period)
|
|
17
|
-
p = parameters(
|
|
18
|
-
period
|
|
19
|
-
).gov.irs.deductions.itemized.salt_and_real_estate
|
|
20
|
-
max_cap = p.cap[filing_status]
|
|
21
|
-
p_ref = parameters(period).gov.contrib.salt_phase_out
|
|
22
|
-
agi = tax_unit("adjusted_gross_income", period)
|
|
23
|
-
agi_excess = max_(0, agi - p_ref.threshold[filing_status])
|
|
24
|
-
phase_out = p_ref.rate * agi_excess
|
|
25
|
-
phased_out_cap = max_(0, max_cap - phase_out)
|
|
26
|
-
if p_ref.floor.applies:
|
|
27
|
-
floor = p_ref.floor.amount[filing_status]
|
|
28
|
-
return max_(phased_out_cap, floor)
|
|
29
|
-
return phased_out_cap
|
|
30
|
-
|
|
31
|
-
class reform(Reform):
|
|
32
|
-
def apply(self):
|
|
33
|
-
self.update_variable(salt_cap)
|
|
34
|
-
|
|
35
|
-
return reform
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def create_salt_phase_out_reform(parameters, period, bypass: bool = False):
|
|
39
|
-
if bypass:
|
|
40
|
-
return create_salt_phase_out()
|
|
41
|
-
|
|
42
|
-
p = parameters.gov.contrib.salt_phase_out
|
|
43
|
-
|
|
44
|
-
reform_active = False
|
|
45
|
-
current_period = period_(period)
|
|
46
|
-
|
|
47
|
-
for i in range(5):
|
|
48
|
-
if p(current_period).in_effect:
|
|
49
|
-
reform_active = True
|
|
50
|
-
break
|
|
51
|
-
current_period = current_period.offset(1, "year")
|
|
52
|
-
|
|
53
|
-
if reform_active:
|
|
54
|
-
return create_salt_phase_out()
|
|
55
|
-
else:
|
|
56
|
-
return None
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
salt_phase_out_reform = create_salt_phase_out_reform(None, None, bypass=True)
|