policyengine-us 1.424.6__py3-none-any.whl → 1.425.4__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/bls/cpi/c_cpi_u.yaml +23 -6
- policyengine_us/parameters/gov/bls/cpi/cpi_u.yaml +21 -18
- policyengine_us/parameters/gov/bls/cpi/cpi_w.yaml +25 -22
- policyengine_us/parameters/gov/contrib/harris/capital_gains/rates.yaml +12 -0
- policyengine_us/parameters/gov/contrib/harris/capital_gains/thresholds.yaml +168 -0
- policyengine_us/parameters/gov/irs/ald/student_loan_interest/reduction/start.yaml +7 -1
- policyengine_us/parameters/gov/irs/capital_gains/rates.yaml +17 -0
- policyengine_us/parameters/gov/irs/capital_gains/thresholds.yaml +182 -0
- policyengine_us/parameters/gov/irs/credits/ctc/amount/base.yaml +14 -9
- policyengine_us/parameters/gov/irs/credits/ctc/refundable/individual_max.yaml +14 -7
- policyengine_us/parameters/gov/irs/credits/eitc/max.yaml +73 -81
- policyengine_us/parameters/gov/irs/deductions/qbi/phase_out/start.yaml +19 -7
- policyengine_us/parameters/gov/irs/deductions/standard/aged_or_blind/amount.yaml +10 -52
- policyengine_us/parameters/gov/irs/deductions/standard/amount.yaml +16 -59
- policyengine_us/parameters/gov/irs/gross_income/retirement_contributions/catch_up/limit/401k.yaml +8 -1
- policyengine_us/parameters/gov/irs/gross_income/retirement_contributions/catch_up/limit/ira.yaml +7 -0
- policyengine_us/parameters/gov/irs/gross_income/retirement_contributions/limit/401k.yaml +6 -0
- policyengine_us/parameters/gov/irs/gross_income/retirement_contributions/limit/ira.yaml +5 -0
- policyengine_us/parameters/gov/irs/income/amt/exemption/amount.yaml +15 -59
- policyengine_us/parameters/gov/irs/income/amt/exemption/phase_out/start.yaml +11 -60
- policyengine_us/parameters/gov/irs/income/bracket.yaml +114 -213
- policyengine_us/reforms/additional_tax_bracket/additional_tax_bracket_reform.py +10 -7
- policyengine_us/reforms/biden/budget_2025/capital_gains_tax_increase.py +5 -7
- policyengine_us/reforms/ctc/ctc_per_child_phase_out.py +30 -8
- policyengine_us/reforms/harris/capital_gains/harris_capital_gains.py +7 -7
- policyengine_us/reforms/states/ri/exemption/ri_exemption_reform.py +12 -3
- policyengine_us/tests/policy/contrib/additional_tax_bracket/additional_tax_bracket_reform.yaml +4 -4
- policyengine_us/tests/policy/contrib/congress/tlaib/income_security/state_integration.yaml +5 -10
- policyengine_us/tests/policy/contrib/congress/tlaib/income_security/unit_tests.yaml +1 -1
- policyengine_us/tests/policy/contrib/crfb/senior_deduction_extension.yaml +2 -2
- policyengine_us/tests/policy/contrib/ctc/integration.yaml +6 -6
- policyengine_us/tests/policy/contrib/states/ri/exemption_reform_test.yaml +29 -0
- policyengine_us/variables/gov/irs/tax/federal_income/alternative_minimum_tax/amt_tax_including_cg.py +5 -9
- policyengine_us/variables/gov/irs/tax/federal_income/alternative_minimum_tax/regular_tax_before_credits.py +12 -13
- policyengine_us/variables/gov/irs/tax/federal_income/capital_gains/capital_gains_excluded_from_taxable_income.py +2 -2
- policyengine_us/variables/gov/irs/tax/federal_income/capital_gains/capital_gains_tax.py +5 -5
- policyengine_us/variables/gov/irs/tax/federal_income/capital_gains/dwks19.py +2 -2
- {policyengine_us-1.424.6.dist-info → policyengine_us-1.425.4.dist-info}/METADATA +1 -1
- {policyengine_us-1.424.6.dist-info → policyengine_us-1.425.4.dist-info}/RECORD +42 -40
- policyengine_us/parameters/gov/contrib/harris/capital_gains/brackets.yaml +0 -194
- policyengine_us/parameters/gov/irs/capital_gains/brackets.yaml +0 -188
- {policyengine_us-1.424.6.dist-info → policyengine_us-1.425.4.dist-info}/WHEEL +0 -0
- {policyengine_us-1.424.6.dist-info → policyengine_us-1.425.4.dist-info}/entry_points.txt +0 -0
- {policyengine_us-1.424.6.dist-info → policyengine_us-1.425.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -29,18 +29,29 @@ def create_ctc_per_child_phase_out() -> Reform:
|
|
|
29
29
|
excess = max_(0, income - phase_out_threshold)
|
|
30
30
|
increments = np.ceil(excess / p.increment)
|
|
31
31
|
reduction_amount = p.amount * qualifying_children
|
|
32
|
-
|
|
32
|
+
base_reduction_uncapped = increments * reduction_amount
|
|
33
33
|
|
|
34
34
|
# Option to avoid overlap between regular and ARPA phase-outs
|
|
35
35
|
p_contrib = parameters(period).gov.contrib.ctc.per_child_phase_out
|
|
36
36
|
if p_contrib.avoid_overlap:
|
|
37
|
-
#
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
# Sequential application: ARPA phase-out reduces ARPA addition only,
|
|
38
|
+
# then regular phase-out applies to base + remaining ARPA
|
|
39
|
+
# NOTE: ctc_arpa_addition already has ARPA phase-out subtracted,
|
|
40
|
+
# so we only need to return the regular phase-out here
|
|
41
|
+
arpa_addition = tax_unit("ctc_arpa_addition", period)
|
|
42
|
+
base_ctc = tax_unit("ctc_maximum", period)
|
|
43
|
+
|
|
44
|
+
# Regular phase-out applies to base CTC + remaining ARPA addition
|
|
45
|
+
ctc_before_regular = base_ctc + arpa_addition
|
|
46
|
+
base_reduction = min_(
|
|
47
|
+
base_reduction_uncapped, ctc_before_regular
|
|
40
48
|
)
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
|
|
50
|
+
# Return only the regular phase-out
|
|
51
|
+
# ARPA phase-out is already applied in ctc_arpa_addition
|
|
43
52
|
return base_reduction
|
|
53
|
+
else:
|
|
54
|
+
return base_reduction_uncapped
|
|
44
55
|
|
|
45
56
|
class ctc_arpa_uncapped_phase_out(Variable):
|
|
46
57
|
value_type = float
|
|
@@ -58,9 +69,20 @@ def create_ctc_per_child_phase_out() -> Reform:
|
|
|
58
69
|
# The ARPA CTC has two phase-outs: the original, and a new phase-out
|
|
59
70
|
# applying before and only to the increase in the maximum CTC under ARPA.
|
|
60
71
|
# Calculate the income used to assess the new phase-out.
|
|
61
|
-
|
|
72
|
+
arpa_threshold = tax_unit("ctc_arpa_phase_out_threshold", period)
|
|
62
73
|
agi = tax_unit("adjusted_gross_income", period)
|
|
63
|
-
|
|
74
|
+
|
|
75
|
+
# Check if we should cap ARPA phase-out to avoid overlap with regular phase-out
|
|
76
|
+
p_contrib = parameters(period).gov.contrib.ctc.per_child_phase_out
|
|
77
|
+
if p_contrib.avoid_overlap:
|
|
78
|
+
# Cap the ARPA phase-out at the regular phase-out threshold
|
|
79
|
+
# so ARPA only applies to income between its threshold and the regular threshold
|
|
80
|
+
regular_threshold = tax_unit("ctc_phase_out_threshold", period)
|
|
81
|
+
capped_income = min_(agi, regular_threshold)
|
|
82
|
+
excess = max_(0, capped_income - arpa_threshold)
|
|
83
|
+
else:
|
|
84
|
+
excess = max_(0, agi - arpa_threshold)
|
|
85
|
+
|
|
64
86
|
increments = np.ceil(excess / p.increment)
|
|
65
87
|
qualifying_children = tax_unit("ctc_qualifying_children", period)
|
|
66
88
|
reduction_amount = p.amount * qualifying_children
|
|
@@ -29,9 +29,9 @@ def create_harris_capital_gains() -> Reform:
|
|
|
29
29
|
|
|
30
30
|
filing_status = tax_unit("filing_status", period)
|
|
31
31
|
|
|
32
|
-
first_threshold = p_ref.
|
|
33
|
-
second_threshold = p_ref.
|
|
34
|
-
third_threshold = p_ref.
|
|
32
|
+
first_threshold = p_ref.thresholds["1"][filing_status]
|
|
33
|
+
second_threshold = p_ref.thresholds["2"][filing_status]
|
|
34
|
+
third_threshold = p_ref.thresholds["3"][filing_status]
|
|
35
35
|
|
|
36
36
|
income_ordinarily_under_second_rate = clip(
|
|
37
37
|
taxable_income, 0, first_threshold
|
|
@@ -82,10 +82,10 @@ def create_harris_capital_gains() -> Reform:
|
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
main_cg_tax = (
|
|
85
|
-
cg_in_first_bracket * p_ref.
|
|
86
|
-
+ cg_in_second_bracket * p_ref.
|
|
87
|
-
+ cg_in_third_bracket * p_ref.
|
|
88
|
-
+ cg_in_fourth_bracket * p_ref.
|
|
85
|
+
cg_in_first_bracket * p_ref.rates["1"]
|
|
86
|
+
+ cg_in_second_bracket * p_ref.rates["2"]
|
|
87
|
+
+ cg_in_third_bracket * p_ref.rates["3"]
|
|
88
|
+
+ cg_in_fourth_bracket * p_ref.rates["4"]
|
|
89
89
|
)
|
|
90
90
|
|
|
91
91
|
unrecaptured_s_1250_gain = tax_unit(
|
|
@@ -86,16 +86,25 @@ def create_ri_exemption_reform() -> Reform:
|
|
|
86
86
|
def formula(tax_unit, period, parameters):
|
|
87
87
|
p_base = parameters(period).gov.states.ri.tax.income.exemption
|
|
88
88
|
|
|
89
|
-
#
|
|
89
|
+
# Calculate personal exemptions base amount
|
|
90
90
|
filing_status = tax_unit("filing_status", period)
|
|
91
91
|
personal_exemptions = where(
|
|
92
92
|
filing_status == filing_status.possible_values.JOINT,
|
|
93
93
|
2,
|
|
94
94
|
1,
|
|
95
95
|
)
|
|
96
|
-
|
|
96
|
+
personal_exemption_base = personal_exemptions * p_base.amount
|
|
97
|
+
|
|
98
|
+
# Apply baseline phase-out to personal exemptions
|
|
99
|
+
mod_agi = tax_unit("ri_agi", period)
|
|
100
|
+
excess_agi = max_(0, mod_agi - p_base.reduction.start)
|
|
101
|
+
increments = np.ceil(excess_agi / p_base.reduction.increment)
|
|
102
|
+
reduction_rate = min_(p_base.reduction.rate * increments, 1)
|
|
103
|
+
personal_exemption_amount = personal_exemption_base * (
|
|
104
|
+
1 - reduction_rate
|
|
105
|
+
)
|
|
97
106
|
|
|
98
|
-
# Add dependent exemption
|
|
107
|
+
# Add dependent exemption (has its own phase-out logic)
|
|
99
108
|
dependent_exemption_amount = tax_unit(
|
|
100
109
|
"ri_dependent_exemption", period
|
|
101
110
|
)
|
policyengine_us/tests/policy/contrib/additional_tax_bracket/additional_tax_bracket_reform.yaml
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
taxable_income: 1_000_000
|
|
23
23
|
filing_status: JOINT
|
|
24
24
|
output:
|
|
25
|
-
regular_tax_before_credits:
|
|
26
|
-
income_tax_main_rates:
|
|
25
|
+
regular_tax_before_credits: 290_689
|
|
26
|
+
income_tax_main_rates: 290_689
|
|
27
27
|
|
|
28
28
|
- name: Additional tax bracket is applied, taxable income is below the threshold.
|
|
29
29
|
period: 2027
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
taxable_income: 600_000
|
|
50
50
|
filing_status: JOINT
|
|
51
51
|
output:
|
|
52
|
-
regular_tax_before_credits:
|
|
53
|
-
income_tax_main_rates:
|
|
52
|
+
regular_tax_before_credits: 146_355
|
|
53
|
+
income_tax_main_rates: 146_355
|
|
@@ -36,10 +36,8 @@
|
|
|
36
36
|
state_code: OK
|
|
37
37
|
output:
|
|
38
38
|
# Federal CTC/EITC calculated for state reference
|
|
39
|
-
ctc:
|
|
40
|
-
|
|
41
|
-
eitc:
|
|
42
|
-
2026: 4_225.342 # Joint, 2 children, $50k income
|
|
39
|
+
ctc: 4_900
|
|
40
|
+
eitc: 4_244
|
|
43
41
|
|
|
44
42
|
# Oklahoma credits (5% of federal)
|
|
45
43
|
ok_child_care_child_tax_credit:
|
|
@@ -91,14 +89,11 @@
|
|
|
91
89
|
state_code: ME
|
|
92
90
|
output:
|
|
93
91
|
# Federal calculations
|
|
94
|
-
ctc:
|
|
95
|
-
|
|
96
|
-
eitc:
|
|
97
|
-
2026: 7_055.704
|
|
92
|
+
ctc: 4_400
|
|
93
|
+
eitc: 7_071
|
|
98
94
|
|
|
99
95
|
# Maine EITC is 25% of federal
|
|
100
|
-
me_eitc:
|
|
101
|
-
2026: 1_763.926
|
|
96
|
+
me_eitc: 1_767
|
|
102
97
|
|
|
103
98
|
# Income Security Package
|
|
104
99
|
baby_bonus_act_payment:
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
# standard_deduction: 38_300 (joint filing in 2029, includes additional standard deduction for seniors)
|
|
57
57
|
# qualified_business_income_deduction: 5_000
|
|
58
58
|
# additional_senior_deduction: 12_000 (from extension)
|
|
59
|
-
taxable_income_deductions_if_not_itemizing:
|
|
59
|
+
taxable_income_deductions_if_not_itemizing: 54_250
|
|
60
60
|
|
|
61
61
|
- name: Integration test - no senior deduction in 2029 without extension
|
|
62
62
|
period: 2029
|
|
@@ -111,4 +111,4 @@
|
|
|
111
111
|
# additional_standard_deduction: 2_450 (single senior aged deduction in 2035)
|
|
112
112
|
# qualified_business_income_deduction: 2_000
|
|
113
113
|
# additional_senior_deduction: 6_000 (from extension)
|
|
114
|
-
taxable_income_deductions_if_not_itemizing:
|
|
114
|
+
taxable_income_deductions_if_not_itemizing: 29_450
|
|
@@ -355,8 +355,8 @@
|
|
|
355
355
|
members: [person1, person2]
|
|
356
356
|
state_code: TX
|
|
357
357
|
output:
|
|
358
|
-
ctc_arpa_uncapped_phase_out:
|
|
359
|
-
ctc_phase_out:
|
|
358
|
+
ctc_arpa_uncapped_phase_out: 1_875
|
|
359
|
+
ctc_phase_out: 500
|
|
360
360
|
ctc: 2_425
|
|
361
361
|
refundable_ctc: 2_425
|
|
362
362
|
|
|
@@ -507,7 +507,7 @@
|
|
|
507
507
|
members: [person1, person2, person3]
|
|
508
508
|
state_code: TX
|
|
509
509
|
output:
|
|
510
|
-
ctc_arpa_uncapped_phase_out:
|
|
511
|
-
ctc_phase_out:
|
|
512
|
-
ctc:
|
|
513
|
-
refundable_ctc:
|
|
510
|
+
ctc_arpa_uncapped_phase_out: 3_750
|
|
511
|
+
ctc_phase_out: 2_500
|
|
512
|
+
ctc: 3_350
|
|
513
|
+
refundable_ctc: 3_350
|
|
@@ -86,3 +86,32 @@
|
|
|
86
86
|
# Dependent exemption after phaseout: 5_100 - 1_000 = 4_100
|
|
87
87
|
# Final: 5_050 (personal) + 4_100 (dependent) = 9_150
|
|
88
88
|
ri_exemptions: 9_150
|
|
89
|
+
|
|
90
|
+
- name: RI exemption reform - high income personal exemption baseline phaseout
|
|
91
|
+
period: 2024
|
|
92
|
+
reforms: policyengine_us.reforms.states.ri.exemption.ri_exemption_reform.ri_exemption_reform
|
|
93
|
+
input:
|
|
94
|
+
gov.contrib.states.ri.dependent_exemption.in_effect: true
|
|
95
|
+
gov.contrib.states.ri.dependent_exemption.amount: 0
|
|
96
|
+
people:
|
|
97
|
+
parent:
|
|
98
|
+
age: 40
|
|
99
|
+
employment_income: 300_000
|
|
100
|
+
tax_units:
|
|
101
|
+
tax_unit:
|
|
102
|
+
members: [parent]
|
|
103
|
+
filing_status: SINGLE
|
|
104
|
+
households:
|
|
105
|
+
household:
|
|
106
|
+
members: [parent]
|
|
107
|
+
state_name: RI
|
|
108
|
+
output:
|
|
109
|
+
# At AGI of $300,000, personal exemption should be fully phased out
|
|
110
|
+
# Baseline phaseout: starts at $246,450, rate 0.2 per $7,050 increment
|
|
111
|
+
# Excess AGI: $300,000 - $246,450 = $53,550
|
|
112
|
+
# Increments: ceil($53,550 / $7,050) = 8
|
|
113
|
+
# Reduction rate: min(0.2 * 8, 1) = min(1.6, 1) = 1 (100%)
|
|
114
|
+
# Personal exemption: $5,050 * (1 - 1) = $0
|
|
115
|
+
# Dependent exemption: $0 (set to $0 in reform)
|
|
116
|
+
# Final: $0 + $0 = $0
|
|
117
|
+
ri_exemptions: 0
|
policyengine_us/variables/gov/irs/tax/federal_income/alternative_minimum_tax/amt_tax_including_cg.py
CHANGED
|
@@ -34,7 +34,7 @@ class amt_tax_including_cg(Variable):
|
|
|
34
34
|
income_taxes_at_amt_rates = p.income.amt.brackets.calc(excess_income)
|
|
35
35
|
# Line 19 - First CG tax bracket threshold
|
|
36
36
|
filing_status = tax_unit("filing_status", period)
|
|
37
|
-
cg_bracket = p.capital_gains.
|
|
37
|
+
cg_bracket = p.capital_gains.thresholds["1"][filing_status]
|
|
38
38
|
# Line 20 - Schedule D Line 14
|
|
39
39
|
lt_capital_loss_carryover = tax_unit("dwks14", period)
|
|
40
40
|
# Line 21 - Line 20 minus Line 19
|
|
@@ -42,7 +42,7 @@ class amt_tax_including_cg(Variable):
|
|
|
42
42
|
# Line 22 - smaller of Line 12 or Line 13
|
|
43
43
|
smaller_of_income_or_cg = min_(reduced_income, cg_distributions)
|
|
44
44
|
# Line 23 - smaller of Line 22 or Line 21 (amount is taxed at 0%)
|
|
45
|
-
cg_first_rate = p.capital_gains.
|
|
45
|
+
cg_first_rate = p.capital_gains.rates["1"]
|
|
46
46
|
disregarded_gains = (
|
|
47
47
|
min_(smaller_of_income_or_cg, reduced_cg_bracket) * cg_first_rate
|
|
48
48
|
)
|
|
@@ -51,9 +51,7 @@ class amt_tax_including_cg(Variable):
|
|
|
51
51
|
smaller_of_income_or_cg - disregarded_gains, 0
|
|
52
52
|
)
|
|
53
53
|
# Line 25 - Second CG tax bracket threshold
|
|
54
|
-
second_cg_bracket = p.capital_gains.
|
|
55
|
-
filing_status
|
|
56
|
-
]
|
|
54
|
+
second_cg_bracket = p.capital_gains.thresholds["2"][filing_status]
|
|
57
55
|
# Line 26 - same as line 21
|
|
58
56
|
# Line 27 - Schedule D Line 21
|
|
59
57
|
loss_limited_net_capital_gains = tax_unit(
|
|
@@ -73,16 +71,14 @@ class amt_tax_including_cg(Variable):
|
|
|
73
71
|
)
|
|
74
72
|
# Line 31 - multiply Line 30by second CG tax rate
|
|
75
73
|
cg_second_bracket_tax = (
|
|
76
|
-
capped_income_including_cg * p.capital_gains.
|
|
74
|
+
capped_income_including_cg * p.capital_gains.rates["2"]
|
|
77
75
|
)
|
|
78
76
|
# Line 32 - Line 23 plus Line 30
|
|
79
77
|
taxed_gains = disregarded_gains + capped_income_including_cg
|
|
80
78
|
# Line 33 - Line 22 minus Line 32
|
|
81
79
|
excess_taxed_gains = max_(0, smaller_of_income_or_cg - taxed_gains)
|
|
82
80
|
# Line 34 - multiply Line 33 by third CG tax rate
|
|
83
|
-
cg_third_bracket_tax =
|
|
84
|
-
excess_taxed_gains * p.capital_gains.brackets.rates["3"]
|
|
85
|
-
)
|
|
81
|
+
cg_third_bracket_tax = excess_taxed_gains * p.capital_gains.rates["3"]
|
|
86
82
|
# Line 35 - sum of Line 17, Line 32, Line 33
|
|
87
83
|
final_taxed_income = excess_income + taxed_gains + excess_taxed_gains
|
|
88
84
|
# Line 36 Line 12 minus Line 35
|
|
@@ -10,29 +10,28 @@ class regular_tax_before_credits(Variable):
|
|
|
10
10
|
unit = USD
|
|
11
11
|
|
|
12
12
|
def formula(tax_unit, period, parameters):
|
|
13
|
+
p = parameters(period).gov.irs
|
|
13
14
|
filing_status = tax_unit("filing_status", period)
|
|
14
15
|
dwks1 = tax_unit("taxable_income", period)
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
dwks16 = min_(capital_gains.thresholds["1"][filing_status], dwks1)
|
|
17
|
+
dwks16 = min_(p.capital_gains.thresholds["1"][filing_status], dwks1)
|
|
19
18
|
dwks17 = min_(tax_unit("dwks14", period), dwks16)
|
|
20
19
|
dwks20 = dwks16 - dwks17
|
|
21
|
-
lowest_rate_tax = capital_gains.rates["1"] * dwks20
|
|
20
|
+
lowest_rate_tax = p.capital_gains.rates["1"] * dwks20
|
|
22
21
|
# Break in worksheet lines
|
|
23
22
|
dwks13 = tax_unit("dwks13", period)
|
|
24
23
|
dwks21 = min_(dwks1, dwks13)
|
|
25
24
|
dwks22 = dwks20
|
|
26
25
|
dwks23 = max_(0, dwks21 - dwks22)
|
|
27
|
-
dwks25 = min_(capital_gains.thresholds["2"][filing_status], dwks1)
|
|
26
|
+
dwks25 = min_(p.capital_gains.thresholds["2"][filing_status], dwks1)
|
|
28
27
|
dwks19 = tax_unit("dwks19", period)
|
|
29
28
|
dwks26 = min_(dwks19, dwks20)
|
|
30
29
|
dwks27 = max_(0, dwks25 - dwks26)
|
|
31
30
|
dwks28 = min_(dwks23, dwks27)
|
|
32
|
-
dwks29 = capital_gains.rates["2"] * dwks28
|
|
31
|
+
dwks29 = p.capital_gains.rates["2"] * dwks28
|
|
33
32
|
dwks30 = dwks22 + dwks28
|
|
34
33
|
dwks31 = dwks21 - dwks30
|
|
35
|
-
dwks32 = capital_gains.rates["3"] * dwks31
|
|
34
|
+
dwks32 = p.capital_gains.rates["3"] * dwks31
|
|
36
35
|
# Break in worksheet lines
|
|
37
36
|
dwks33 = min_(
|
|
38
37
|
tax_unit("dwks09", period),
|
|
@@ -43,18 +42,18 @@ class regular_tax_before_credits(Variable):
|
|
|
43
42
|
dwks36 = max_(0, dwks34 - dwks1)
|
|
44
43
|
dwks37 = max_(0, dwks33 - dwks36)
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
dwks38 = (
|
|
46
|
+
p.income.amt.capital_gains.capital_gain_excess_tax_rate * dwks37
|
|
47
|
+
)
|
|
49
48
|
# Break in worksheet lines
|
|
50
49
|
dwks39 = dwks19 + dwks20 + dwks28 + dwks31 + dwks37
|
|
51
50
|
dwks40 = dwks1 - dwks39
|
|
52
|
-
dwks41 = p.amt.brackets.rates[-1] * dwks40
|
|
51
|
+
dwks41 = p.income.amt.brackets.rates[-1] * dwks40
|
|
53
52
|
|
|
54
53
|
# Compute regular tax using bracket rates and thresholds
|
|
55
54
|
reg_taxinc = max_(0, dwks19)
|
|
56
|
-
bracket_tops = p.bracket.thresholds
|
|
57
|
-
bracket_rates = p.bracket.rates
|
|
55
|
+
bracket_tops = p.income.bracket.thresholds
|
|
56
|
+
bracket_rates = p.income.bracket.rates
|
|
58
57
|
reg_tax = 0
|
|
59
58
|
bracket_bottom = 0
|
|
60
59
|
for i in range(1, len(list(bracket_rates.__iter__())) + 1):
|
|
@@ -14,15 +14,15 @@ class capital_gains_excluded_from_taxable_income(Variable):
|
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
def formula(tax_unit, period, parameters):
|
|
17
|
+
p = parameters(period).gov.irs.capital_gains
|
|
17
18
|
net_capital_gain = tax_unit("net_capital_gain", period)
|
|
18
19
|
adjusted_net_capital_gain = tax_unit(
|
|
19
20
|
"adjusted_net_capital_gain", period
|
|
20
21
|
)
|
|
21
22
|
taxable_income = tax_unit("taxable_income", period)
|
|
22
23
|
filing_status = tax_unit("filing_status", period)
|
|
23
|
-
cg = parameters(period).gov.irs.capital_gains.brackets
|
|
24
24
|
income_taxed_below_first_rate = clip(
|
|
25
|
-
taxable_income, 0,
|
|
25
|
+
taxable_income, 0, p.thresholds["1"][filing_status]
|
|
26
26
|
)
|
|
27
27
|
reduced_taxable_income = max_(
|
|
28
28
|
taxable_income - net_capital_gain,
|
|
@@ -27,8 +27,8 @@ class capital_gains_tax(Variable):
|
|
|
27
27
|
|
|
28
28
|
filing_status = tax_unit("filing_status", period)
|
|
29
29
|
|
|
30
|
-
first_threshold = cg.
|
|
31
|
-
second_threshold = cg.
|
|
30
|
+
first_threshold = cg.thresholds["1"][filing_status]
|
|
31
|
+
second_threshold = cg.thresholds["2"][filing_status]
|
|
32
32
|
|
|
33
33
|
income_ordinarily_under_second_rate = clip(
|
|
34
34
|
taxable_income, 0, first_threshold
|
|
@@ -55,9 +55,9 @@ class capital_gains_tax(Variable):
|
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
main_cg_tax = (
|
|
58
|
-
cg_in_first_bracket * cg.
|
|
59
|
-
+ cg_in_second_bracket * cg.
|
|
60
|
-
+ cg_in_third_bracket * cg.
|
|
58
|
+
cg_in_first_bracket * cg.rates["1"]
|
|
59
|
+
+ cg_in_second_bracket * cg.rates["2"]
|
|
60
|
+
+ cg_in_third_bracket * cg.rates["3"]
|
|
61
61
|
)
|
|
62
62
|
|
|
63
63
|
unrecaptured_s_1250_gain = tax_unit(
|
|
@@ -9,11 +9,11 @@ class dwks19(Variable):
|
|
|
9
9
|
unit = USD
|
|
10
10
|
|
|
11
11
|
def formula(tax_unit, period, parameters):
|
|
12
|
+
p = parameters(period).gov.irs.capital_gains
|
|
12
13
|
dwks14 = tax_unit("dwks14", period)
|
|
13
|
-
capital_gains = parameters(period).gov.irs.capital_gains.brackets
|
|
14
14
|
filing_status = tax_unit("filing_status", period)
|
|
15
15
|
dwks01 = tax_unit("taxable_income", period)
|
|
16
|
-
dwks16 = min_(
|
|
16
|
+
dwks16 = min_(p.thresholds["1"][filing_status], dwks01)
|
|
17
17
|
dwks17 = min_(dwks14, dwks16)
|
|
18
18
|
dwks10 = tax_unit("dwks10", period)
|
|
19
19
|
dwks18 = max_(0, dwks01 - dwks10)
|