policyengine-us 1.393.0__py3-none-any.whl → 1.395.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.

@@ -0,0 +1,8 @@
1
+ description: The senior deduction is extended beyond tax year 2028 if this is true.
2
+ metadata:
3
+ unit: bool
4
+ label: Senior deduction extension in effect
5
+ period: year
6
+
7
+ values:
8
+ 0000-01-01: False
@@ -21,3 +21,6 @@ from .tax_employer_payroll_tax import (
21
21
  from .non_refundable_ss_credit import (
22
22
  create_non_refundable_ss_credit_reform,
23
23
  )
24
+ from .senior_deduction_extension import (
25
+ create_senior_deduction_extension_reform,
26
+ )
@@ -0,0 +1,66 @@
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_senior_deduction_extension() -> Reform:
7
+ def modify_parameters(parameters):
8
+ # Update deductions_if_itemizing to include additional_senior_deduction after 2028
9
+ parameters.gov.irs.deductions.deductions_if_itemizing.update(
10
+ start=instant("2029-01-01"),
11
+ stop=instant("2099-12-31"),
12
+ value=[
13
+ "qualified_business_income_deduction",
14
+ "wagering_losses_deduction",
15
+ "itemized_taxable_income_deductions",
16
+ "additional_senior_deduction",
17
+ ],
18
+ )
19
+
20
+ # Update deductions_if_not_itemizing to include additional_senior_deduction after 2028
21
+ parameters.gov.irs.deductions.deductions_if_not_itemizing.update(
22
+ start=instant("2029-01-01"),
23
+ stop=instant("2099-12-31"),
24
+ value=[
25
+ "standard_deduction",
26
+ "qualified_business_income_deduction",
27
+ "additional_senior_deduction",
28
+ "charitable_deduction_for_non_itemizers",
29
+ ],
30
+ )
31
+
32
+ return parameters
33
+
34
+ class reform(Reform):
35
+ def apply(self):
36
+ self.modify_parameters(modify_parameters)
37
+
38
+ return reform
39
+
40
+
41
+ def create_senior_deduction_extension_reform(
42
+ parameters, period, bypass: bool = False
43
+ ):
44
+ if bypass:
45
+ return create_senior_deduction_extension()
46
+
47
+ p = parameters.gov.contrib.crfb.senior_deduction_extension
48
+
49
+ reform_active = False
50
+ current_period = period_(period)
51
+
52
+ for i in range(5):
53
+ if p(current_period).applies:
54
+ reform_active = True
55
+ break
56
+ current_period = current_period.offset(1, "year")
57
+
58
+ if reform_active:
59
+ return create_senior_deduction_extension()
60
+ else:
61
+ return None
62
+
63
+
64
+ senior_deduction_extension = create_senior_deduction_extension_reform(
65
+ None, None, bypass=True
66
+ )
@@ -103,6 +103,7 @@ from .congress.hawley.awra import (
103
103
  )
104
104
  from .crfb import (
105
105
  create_non_refundable_ss_credit_reform,
106
+ create_senior_deduction_extension_reform,
106
107
  )
107
108
 
108
109
  from policyengine_core.reforms import Reform
@@ -216,6 +217,9 @@ def create_structural_reforms_from_parameters(parameters, period):
216
217
  non_refundable_ss_credit = create_non_refundable_ss_credit_reform(
217
218
  parameters, period
218
219
  )
220
+ senior_deduction_extension = create_senior_deduction_extension_reform(
221
+ parameters, period
222
+ )
219
223
 
220
224
  reconciled_ssn_for_llc_and_aoc = (
221
225
  create_reconciled_ssn_for_llc_and_aoc_reform(parameters, period)
@@ -272,6 +276,7 @@ def create_structural_reforms_from_parameters(parameters, period):
272
276
  tax_employer_payroll_tax,
273
277
  afa_other_dependent_credit,
274
278
  non_refundable_ss_credit,
279
+ senior_deduction_extension,
275
280
  reconciled_ssn_for_llc_and_aoc,
276
281
  ctc_additional_bracket,
277
282
  mi_surtax,
@@ -0,0 +1,114 @@
1
+ - name: Integration test - senior deduction included in taxable income deductions when itemizing in 2029
2
+ period: 2029
3
+ reforms: policyengine_us.reforms.crfb.senior_deduction_extension.senior_deduction_extension
4
+ input:
5
+ gov.contrib.crfb.senior_deduction_extension.applies: true
6
+ people:
7
+ senior1:
8
+ age: 67
9
+ senior2:
10
+ age: 69
11
+ tax_units:
12
+ tax_unit:
13
+ members: [senior1, senior2]
14
+ filing_status: JOINT
15
+ adjusted_gross_income: 100_000
16
+ tax_unit_itemizes: true
17
+ itemized_taxable_income_deductions: 30_000
18
+ qualified_business_income_deduction: 5_000
19
+ wagering_losses_deduction: 0
20
+ households:
21
+ household:
22
+ members: [senior1, senior2]
23
+ state_code: CA
24
+ output:
25
+ additional_senior_deduction: 12_000
26
+ # Total deductions when itemizing should include:
27
+ # itemized_taxable_income_deductions: 30_000
28
+ # qualified_business_income_deduction: 5_000
29
+ # additional_senior_deduction: 12_000 (from extension)
30
+ taxable_income_deductions_if_itemizing: 47_000
31
+
32
+ - name: Integration test - senior deduction included in taxable income deductions when not itemizing in 2029
33
+ period: 2029
34
+ reforms: policyengine_us.reforms.crfb.senior_deduction_extension.senior_deduction_extension
35
+ input:
36
+ gov.contrib.crfb.senior_deduction_extension.applies: true
37
+ people:
38
+ senior1:
39
+ age: 67
40
+ senior2:
41
+ age: 69
42
+ tax_units:
43
+ tax_unit:
44
+ members: [senior1, senior2]
45
+ filing_status: JOINT
46
+ adjusted_gross_income: 100_000
47
+ tax_unit_itemizes: false
48
+ qualified_business_income_deduction: 5_000
49
+ households:
50
+ household:
51
+ members: [senior1, senior2]
52
+ state_code: CA
53
+ output:
54
+ additional_senior_deduction: 12_000
55
+ # Total deductions when not itemizing should include:
56
+ # standard_deduction: 38_300 (joint filing in 2029, includes additional standard deduction for seniors)
57
+ # qualified_business_income_deduction: 5_000
58
+ # additional_senior_deduction: 12_000 (from extension)
59
+ taxable_income_deductions_if_not_itemizing: 55_300
60
+
61
+ - name: Integration test - no senior deduction in 2029 without extension
62
+ period: 2029
63
+ reforms: []
64
+ input:
65
+ people:
66
+ senior1:
67
+ age: 67
68
+ senior2:
69
+ age: 69
70
+ tax_units:
71
+ tax_unit:
72
+ members: [senior1, senior2]
73
+ filing_status: JOINT
74
+ adjusted_gross_income: 100_000
75
+ tax_unit_itemizes: true
76
+ itemized_taxable_income_deductions: 30_000
77
+ qualified_business_income_deduction: 5_000
78
+ wagering_losses_deduction: 0
79
+ households:
80
+ household:
81
+ members: [senior1, senior2]
82
+ state_code: CA
83
+ output:
84
+ additional_senior_deduction: 12_000
85
+ # Without extension, senior deduction is calculated but NOT included in deductions for 2029
86
+ taxable_income_deductions_if_itemizing: 35_000
87
+
88
+ - name: Integration test - extension continues working in 2035
89
+ period: 2035
90
+ reforms: policyengine_us.reforms.crfb.senior_deduction_extension.senior_deduction_extension
91
+ input:
92
+ gov.contrib.crfb.senior_deduction_extension.applies: true
93
+ people:
94
+ senior:
95
+ age: 70
96
+ tax_units:
97
+ tax_unit:
98
+ members: [senior]
99
+ filing_status: SINGLE
100
+ adjusted_gross_income: 50_000
101
+ tax_unit_itemizes: false
102
+ qualified_business_income_deduction: 2_000
103
+ households:
104
+ household:
105
+ members: [senior]
106
+ state_code: CA
107
+ output:
108
+ additional_senior_deduction: 6_000
109
+ # Total deductions should include:
110
+ # basic_standard_deduction: 19_600 (single filing in 2035)
111
+ # additional_standard_deduction: 2_450 (single senior aged deduction in 2035)
112
+ # qualified_business_income_deduction: 2_000
113
+ # additional_senior_deduction: 6_000 (from extension)
114
+ taxable_income_deductions_if_not_itemizing: 30_050
@@ -20,9 +20,9 @@ class SelectiveTestRunner:
20
20
 
21
21
  # Define regex patterns for matching files to tests
22
22
  self.test_patterns = [
23
- # Rule 1: Match gov folders (excluding states) to their test directories
23
+ # Rule 1: Match gov folders (excluding states and contrib) to their test directories
24
24
  {
25
- "file_pattern": r"policyengine_us/(parameters|variables)/gov/(?!states/)([^/]+)",
25
+ "file_pattern": r"policyengine_us/(parameters|variables)/gov/(?!states/|contrib/)([^/]+)",
26
26
  "test_pattern": r"policyengine_us/tests/policy/baseline/gov/\2",
27
27
  },
28
28
  # Rule 2: Match state-specific changes to state tests
@@ -35,7 +35,12 @@ class SelectiveTestRunner:
35
35
  "file_pattern": r"policyengine_us/(parameters|variables)/gov/local/([^/]+)",
36
36
  "test_pattern": r"policyengine_us/tests/policy/baseline/gov/local/\2",
37
37
  },
38
- # Match reforms to reform tests
38
+ # Match reforms in specific organization folders to their contrib test folders
39
+ {
40
+ "file_pattern": r"policyengine_us/reforms/([^/]+)/",
41
+ "test_pattern": r"policyengine_us/tests/policy/contrib/\1",
42
+ },
43
+ # Match general reforms to reform tests
39
44
  {
40
45
  "file_pattern": r"policyengine_us/reforms/",
41
46
  "test_pattern": r"policyengine_us/tests/policy/reform",
@@ -45,6 +50,11 @@ class SelectiveTestRunner:
45
50
  "file_pattern": r"policyengine_us/parameters/contrib/",
46
51
  "test_pattern": r"policyengine_us/tests/policy/contrib",
47
52
  },
53
+ # Match gov/contrib parameters to their specific contrib subfolder tests
54
+ {
55
+ "file_pattern": r"policyengine_us/parameters/gov/contrib/([^/]+)/",
56
+ "test_pattern": r"policyengine_us/tests/policy/contrib/\1",
57
+ },
48
58
  # Match household variables to household tests
49
59
  {
50
60
  "file_pattern": r"policyengine_us/variables/household/",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: policyengine-us
3
- Version: 1.393.0
3
+ Version: 1.395.0
4
4
  Summary: Add your description here.
5
5
  Author-email: PolicyEngine <hello@policyengine.org>
6
6
  License-File: LICENSE
@@ -183,6 +183,7 @@ policyengine_us/parameters/gov/contrib/congress/wftca/bonus_guaranteed_deduction
183
183
  policyengine_us/parameters/gov/contrib/congress/wftca/bonus_guaranteed_deduction/phase_out/threshold.yaml,sha256=D7QFIbulmExcc9MVzeEz64isJ9_jscq8ujgDvJMzRlY,906
184
184
  policyengine_us/parameters/gov/contrib/congress/wyden_smith/actc_lookback.yaml,sha256=7nW2PVchIb6Slfip6iPtIqSrmdYoOrFhn0M7N7D6EIY,437
185
185
  policyengine_us/parameters/gov/contrib/congress/wyden_smith/per_child_actc_phase_in.yaml,sha256=3Uer49v5OPi7uDAuGnsSlr_L0EnyeDOlKcQGJYIQ4Ro,418
186
+ policyengine_us/parameters/gov/contrib/crfb/senior_deduction_extension/applies.yaml,sha256=yDW2L4TT9yhmut8SLQTky3vcXnmVxs9YfR4D1_2wmZ8,197
186
187
  policyengine_us/parameters/gov/contrib/crfb/ss_credit/amount.yaml,sha256=3A_cUbpE6qPOej_CCmCwD7U9-_nDWxqgLF9Sw6s15zo,492
187
188
  policyengine_us/parameters/gov/contrib/crfb/ss_credit/in_effect.yaml,sha256=4xq1pNu6_rSP3xjjcgJNolbMQJOrcEKrZn0hAcdOWcI,347
188
189
  policyengine_us/parameters/gov/contrib/crfb/tax_employer_medicare_tax/in_effect.yaml,sha256=E2lrX7YCKkIctuL1bw4dlMXDQnLKW29jwYV9temCYsY,221
@@ -3114,7 +3115,7 @@ policyengine_us/params_on_demand/gov/hhs/medicaid/geography/medicaid_rating_area
3114
3115
  policyengine_us/reforms/__init__.py,sha256=FPV8k2633kzUhbKUK8jC6yJONbnZ5n9zLAq2UL57KH4,113
3115
3116
  policyengine_us/reforms/dc_kccatc.py,sha256=LyGMfEKe-0TgQ-2vCYGOD8W-EGEW8_DgIqCQP89qDyg,4283
3116
3117
  policyengine_us/reforms/dc_tax_threshold_joint_ratio.py,sha256=G-5E1EJFGZ3VeUl_fuyj82nMIttHRNRdlT-x98koJrk,1633
3117
- policyengine_us/reforms/reforms.py,sha256=MNsiN7aXbr8MfEpeVpXB0MxRxHpa9-i8zscaWFWkQio,9706
3118
+ policyengine_us/reforms/reforms.py,sha256=clBmQkfuj2MFmcJHUu7I0smBD6wCjA4iqp4JKGav3v4,9896
3118
3119
  policyengine_us/reforms/taxsim.py,sha256=bXNFWfjBX5USld1C7fziT6BBmRy-avz00QtL8WmCHy0,5276
3119
3120
  policyengine_us/reforms/winship.py,sha256=_q74Af1nkmoh0-M6PZJ2FcJAn6v5zf5sAEgvxjwHwyA,3069
3120
3121
  policyengine_us/reforms/additional_tax_bracket/__init__.py,sha256=087GDzojnzkbARUgGTQDMNVWJzjtNZvBGr46jfu1kXc,89
@@ -3144,8 +3145,9 @@ policyengine_us/reforms/congress/tlaib/boost/__init__.py,sha256=mTOD_i0DRodonczS
3144
3145
  policyengine_us/reforms/congress/tlaib/boost/boost_middle_class_tax_credit.py,sha256=i-QXr3jR8yTq8XDUdytE7FXjSlNTdBcXV5QZQqrNAZw,5964
3145
3146
  policyengine_us/reforms/congress/wyden_smith/__init__.py,sha256=E2ZbN4mRYi9FniynFYQiWk18byKe_-WmAp9tpG1aXnU,55
3146
3147
  policyengine_us/reforms/congress/wyden_smith/ctc_expansion.py,sha256=SLqv8nk2gQT9xH8amGZMOgbljIkxPMSvL3RC1IMyLsA,5269
3147
- policyengine_us/reforms/crfb/__init__.py,sha256=na1OcXNKdnI-L9qEKU1HoDOLz7I7LS9Wa7e0fTkaZpc,740
3148
+ policyengine_us/reforms/crfb/__init__.py,sha256=IGlcXcMYsTgW3mGt2DRvygTM9hz3V3IVXFkHS2Zu8Jo,830
3148
3149
  policyengine_us/reforms/crfb/non_refundable_ss_credit.py,sha256=bMEGGi1R16fnfBeNhiRFXh9DfpVyq4dZH1jcsidf-2c,5453
3150
+ policyengine_us/reforms/crfb/senior_deduction_extension.py,sha256=Hdg16tmU8bYUa9Xbhp97wShZbwKUjJ9ahD_VpgV9LsE,2036
3149
3151
  policyengine_us/reforms/crfb/tax_employer_medicare_tax.py,sha256=Hc2GVwoXn2b_izOyoEpocySLo11BdmzFnyQoEiHJsFI,4236
3150
3152
  policyengine_us/reforms/crfb/tax_employer_payroll_tax.py,sha256=-V6vv51aYb0NRuB4mjqfjD6yGNSLqqgbKVhVG455U3I,4678
3151
3153
  policyengine_us/reforms/crfb/tax_employer_social_security_tax.py,sha256=hawAdLtwCnY3_7jUVPTM0KpeYRfT7tVk0xqCMhdxP4E,4292
@@ -3194,7 +3196,7 @@ policyengine_us/reforms/tax_exempt/__init__.py,sha256=v3EbtUk6a2jsi9MrOlyb8ckzPy
3194
3196
  policyengine_us/reforms/tax_exempt/tax_exempt_reform.py,sha256=bkW91XMJ-jd23nhq4-PfWJv0YW2whVn98cQikbq6-Z8,2427
3195
3197
  policyengine_us/reforms/treasury/__init__.py,sha256=406jIbu32B57tUKhVLflWxlXf3S4SWjclVqlEtMeMwg,92
3196
3198
  policyengine_us/reforms/treasury/repeal_dependent_exemptions.py,sha256=-xyMCtUK_dIBn2aAmhPW8pJEZjxcgOZzWKEUSI3w5e8,1354
3197
- policyengine_us/tests/run_selective_tests.py,sha256=kVuz9-CEXL2db8MuFi1J3cHj_Mqx28retvAPX8N3LCY,22571
3199
+ policyengine_us/tests/run_selective_tests.py,sha256=xQiFaJH3z7PCh9IHXyUU9zC2dTT9K75XlFyjCeP_OBo,23139
3198
3200
  policyengine_us/tests/test_batched.py,sha256=K1LN3IIbWIioXWpFXZ6Hlch-BeglV3QPc1zxAbUeP-M,11491
3199
3201
  policyengine_us/tests/code_health/parameters.py,sha256=e9VKC8dmmB_dTafOO90WJuVu-PAogoLAaa5QZd2rY-s,1126
3200
3202
  policyengine_us/tests/code_health/variable_names.py,sha256=hY4ucqPwBD7v_fvnBpzexJDf0yCGpF4Sueff4z4rQ24,554
@@ -5198,6 +5200,7 @@ policyengine_us/tests/policy/contrib/congress/tlaib/boost/boost_middle_class_tax
5198
5200
  policyengine_us/tests/policy/contrib/congress/tlaib/end_child_poverty_act/ecpa_filer_credit.yaml,sha256=kWLbi3IrulWIxG-JmCXuCg5ItexVNhKSPSDRPPp9meg,460
5199
5201
  policyengine_us/tests/policy/contrib/congress/tlaib/end_child_poverty_act/integration.yaml,sha256=ftBPYvBYAcU-eqk36RQaurDomA9P657tw3V6n107YBk,3692
5200
5202
  policyengine_us/tests/policy/contrib/crfb/non_refundable_ss_credit.yaml,sha256=ycLoBzbBzgSJ1RuAin4Y3SIlNu3TgtUY9QJp15dvTTQ,2773
5203
+ policyengine_us/tests/policy/contrib/crfb/senior_deduction_extension.yaml,sha256=fSNw623ybWllhfn3VsYVwS_vE1E08Ko1BLB_OtQsx2U,3876
5201
5204
  policyengine_us/tests/policy/contrib/crfb/tax_employer_all_payroll_tax.yaml,sha256=ljSr35bDosWTqTDqEZKWhRqZvIw7SwPVMY-O8YFIsLc,559
5202
5205
  policyengine_us/tests/policy/contrib/crfb/tax_employer_medicare_tax.yaml,sha256=jE-_SssrvqdWuVgw9GrA1sJy6dvrvKuMHwZCHm48oRc,446
5203
5206
  policyengine_us/tests/policy/contrib/crfb/tax_employer_payroll_tax_percentage.yaml,sha256=N3l6vYyluEGIbd2HfSQFuAYPzg0r4CC0JZujm3-joO8,5510
@@ -8389,8 +8392,8 @@ policyengine_us/variables/input/farm_income.py,sha256=BEKxYmHNNnWJAAvULl5qZJigy5
8389
8392
  policyengine_us/variables/input/geography.py,sha256=Ux0ueAf0rhZaflyEqz81UuXP3xKCKBDvoO3CrKhiQEc,5421
8390
8393
  policyengine_us/variables/input/self_employment_income.py,sha256=PwsGz8R4lRikKWUYOhsC0qosNNLXq4f5SQmfw4S3mk8,511
8391
8394
  policyengine_us/variables/input/self_employment_income_before_lsr.py,sha256=E8fcX9Nlyqz8dziHhQv_euutdmoIwFMMWePUwbbwv_w,379
8392
- policyengine_us-1.393.0.dist-info/METADATA,sha256=eFUdYfJkkDyQm1hVQrg7LwFtjpVaI2cEbuMSLCz42Bg,1649
8393
- policyengine_us-1.393.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8394
- policyengine_us-1.393.0.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
8395
- policyengine_us-1.393.0.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
8396
- policyengine_us-1.393.0.dist-info/RECORD,,
8395
+ policyengine_us-1.395.0.dist-info/METADATA,sha256=VRjQmwEUnHQWm6pkausMC5t1Vay5NI2H01ukZYTnQdE,1649
8396
+ policyengine_us-1.395.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8397
+ policyengine_us-1.395.0.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
8398
+ policyengine_us-1.395.0.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
8399
+ policyengine_us-1.395.0.dist-info/RECORD,,