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

Files changed (19) hide show
  1. policyengine_us/parameters/gov/bls/cpi/c_cpi_u.yaml +2 -4
  2. policyengine_us/parameters/gov/bls/cpi/cpi_u.yaml +1 -3
  3. policyengine_us/parameters/gov/bls/cpi/cpi_w.yaml +2 -17
  4. policyengine_us/parameters/gov/hhs/uprating.yaml +4 -3
  5. policyengine_us/parameters/gov/irs/uprating.py +9 -23
  6. policyengine_us/parameters/gov/ssa/uprating.yaml +7 -4
  7. policyengine_us/parameters/gov/usda/snap/uprating.yaml +1 -0
  8. policyengine_us/parameters/uprating_extensions.py +144 -0
  9. policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/credits/refundable_ctc/pr_refundable_ctc.yaml +21 -0
  10. policyengine_us/tests/policy/baseline/parameters/test_uprating_extensions.py +108 -0
  11. policyengine_us/variables/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit_eligible.py +1 -1
  12. policyengine_us/variables/gov/territories/pr/tax/income/credits/refundable_ctc/pr_refundable_ctc.py +34 -0
  13. policyengine_us/variables/gov/territories/pr/tax/income/credits/refundable_ctc/pr_refundable_ctc_social_security_tax.py +16 -0
  14. policyengine_us/variables/gov/territories/pr/tax/income/pr_gross_income_person.py +1 -1
  15. {policyengine_us-1.371.0.dist-info → policyengine_us-1.373.0.dist-info}/METADATA +1 -1
  16. {policyengine_us-1.371.0.dist-info → policyengine_us-1.373.0.dist-info}/RECORD +19 -14
  17. {policyengine_us-1.371.0.dist-info → policyengine_us-1.373.0.dist-info}/WHEEL +0 -0
  18. {policyengine_us-1.371.0.dist-info → policyengine_us-1.373.0.dist-info}/entry_points.txt +0 -0
  19. {policyengine_us-1.371.0.dist-info → policyengine_us-1.373.0.dist-info}/licenses/LICENSE +0 -0
@@ -304,14 +304,12 @@ values:
304
304
  2032-02-01: 203.1 # 2033 value.
305
305
  2033-02-01: 207.1 # 2034 value.
306
306
  2034-02-01: 211.2 # 2035 value.
307
- 2035-02-01: 215.4 # 2036 value (indexed by applying 2035 indexing rate (211.2/207.1) and multiplying it by 211.2).
307
+ # Values for 2035-2100 are set programmatically in uprating_extensions.py
308
308
  metadata:
309
+ economy: false
309
310
  unit: currency-USD
310
311
  label: Chained CPI-U
311
- economy: false
312
312
  reference:
313
- - title: "su.data.0.Current (SUUR0000SA0)"
314
- href: https://download.bls.gov/pub/time.series/su/su.data.0.Current
315
313
  - title: CBO | Tax Parameters and Effective Marginal Tax Rates | June 2024
316
314
  # Source: https://www.cbo.gov/data/budget-economic-data#10
317
315
  # Row: 159
@@ -1359,14 +1359,12 @@ values:
1359
1359
  2032-02-01: 372.7 # 2033 value.
1360
1360
  2033-02-01: 381.0 # 2034 value.
1361
1361
  2034-02-01: 389.6 # 2035 value.
1362
- 2035-02-01: 398.7 # (indexed by applying 2035 indexing rate (389.6/381.0) and multiplying it by 389.6).
1362
+ # Values for 2035-2100 are set programmatically in uprating_extensions.py
1363
1363
  metadata:
1364
1364
  unit: currency-USD
1365
1365
  label: CPI-U
1366
1366
  economy: false
1367
1367
  reference:
1368
- - title: BLS Data Viewer | Consumer Price Index for All Urban Consumers (CPI-U)
1369
- href: https://beta.bls.gov/dataViewer/view/timeseries/CUUR0000SA0
1370
1368
  - title: CBO | Tax Parameters and Effective Marginal Tax Rates | June 2024
1371
1369
  # Source: https://www.cbo.gov/data/budget-economic-data#10
1372
1370
  # Row: 158
@@ -1386,27 +1386,12 @@ values:
1386
1386
  2033-08-01: 377.038 # 2033Q3: 384.9 * 309.141 / 315.587
1387
1387
  2033-11-01: 379.193 # 2033Q4: 387.1 * 309.141 / 315.587
1388
1388
  2034-02-01: 381.250 # 2034Q1: 389.2 * 309.141 / 315.587
1389
- 2034-05-01: 383.405 # 2034Q2: 391.4 * 309.141 / 315.587
1390
- 2034-08-01: 385.561 # 2034Q3: 393.6 * 309.141 / 315.587
1391
- 2034-11-01: 387.716 # 2034Q4: 395.8 * 309.141 / 315.587
1392
- 2035-02-01: 389.871 # 2035Q1: 398.0 * 309.141 / 315.587
1393
- 2035-05-01: 392.026 # 2035Q2: 400.2 * 309.141 / 315.587
1394
- 2035-08-01: 394.279 # 2035Q3: 402.5 * 309.141 / 315.587
1395
- 2035-11-01: 396.434 # 2035Q4: 404.7 * 309.141 / 315.587
1396
-
1389
+ # Values for 2035-2100 are set programmatically in uprating_extensions.py
1397
1390
  metadata:
1398
1391
  unit: currency-USD
1399
1392
  label: CPI-W
1400
1393
  economy: false
1401
1394
  reference:
1402
- - title: BLS Data Viewer | Consumer Price Index for Urban Wage Earners and Clerical Workers (CPI-W)
1403
- href: https://beta.bls.gov/dataViewer/view/timeseries/CWUR0000SA0
1404
- - title: CBO | Tax Parameters and Effective Marginal Tax Rates | June 2024
1405
- # Source: https://www.cbo.gov/data/budget-economic-data#10
1406
- # Quarterly: Row 51
1407
- href: https://www.cbo.gov/system/files/2024-06/51135-2024-06-Economic-Projections.xlsx
1408
- - title: CBO | Tax Parameters and Effective Marginal Tax Rates | January 2025
1409
- # Source: https://www.cbo.gov/data/budget-economic-data#10
1395
+ - title: CBO | Economic and Budget Projections | January 2025
1410
1396
  # Quarterly: Row 51
1411
1397
  href: https://www.cbo.gov/system/files/2025-01/51135-2025-01-Economic-Projections.xlsx
1412
-
@@ -16,10 +16,11 @@ values:
16
16
  2033-01-01: 383.9
17
17
  2034-01-01: 392.5
18
18
  2035-01-01: 401.3
19
+ # Values for 2036-2100 are set programmatically in uprating_extensions.py
19
20
  metadata:
20
- unit: currency-USD
21
- label: Poverty line uprating
22
21
  economy: false
22
+ unit: currency-USD
23
+ label: HHS uprating
23
24
  reference:
24
25
  - title: 2025 Annual Update of the HHS Poverty Guidelines
25
26
  href: https://www.govinfo.gov/app/details/FR-2025-01-17/2025-01377
@@ -27,4 +28,4 @@ metadata:
27
28
  href: https://www.federalregister.gov/documents/2024/01/17/2024-00796/annual-update-of-the-hhs-poverty-guidelines
28
29
  - title: CBO Budget and Economic Outlook | 2024 to 2034
29
30
  # Jan 2025 Economic Projections | 2. Calendar Year | Row 51
30
- href: https://www.cbo.gov/data/budget-economic-data#4
31
+ href: https://www.cbo.gov/data/budget-economic-data#4
@@ -1,26 +1,12 @@
1
- from policyengine_us.model_api import *
2
- from policyengine_core.periods import instant
1
+ """IRS uprating parameter setup.
3
2
 
3
+ This module imports the unified uprating extension functionality.
4
+ The actual extension logic is in parameters/uprating_extensions.py.
5
+ """
4
6
 
5
- def get_irs_cpi(parameters: ParameterNode, year: int) -> float:
6
- cpi = parameters.gov.bls.cpi.c_cpi_u
7
- end = instant(f"{year}-08-01")
8
- start = end.offset(-MONTHS_IN_YEAR, MONTH)
9
- monthly_cpi_values = []
10
- for month in range(MONTHS_IN_YEAR):
11
- monthly_cpi_values += [cpi(start.offset(month, MONTH))]
12
- return sum(monthly_cpi_values) / MONTHS_IN_YEAR
7
+ from policyengine_us.parameters.uprating_extensions import (
8
+ set_all_uprating_parameters as set_irs_uprating_parameter,
9
+ )
13
10
 
14
-
15
- def set_irs_uprating_parameter(parameters: ParameterNode) -> ParameterNode:
16
-
17
- IRS_UPRATING_START_YEAR = 2010
18
- IRS_UPRATING_END_YEAR = 2035
19
-
20
- uprating_index: Parameter = parameters.gov.irs.uprating
21
- # Note: range is inclusive of start and exclusive of end, so we add 1
22
- for year in range(IRS_UPRATING_START_YEAR, IRS_UPRATING_END_YEAR + 1):
23
- irs_cpi = get_irs_cpi(parameters, year - 1)
24
- uprating_index.update(period=f"year:{year}-01-01:1", value=irs_cpi)
25
- uprating_index.update(start=instant(f"{year}-01-01"), value=irs_cpi)
26
- return parameters
11
+ # For backward compatibility, we keep the same function name
12
+ # but it now calls the unified function that handles all uprating parameters
@@ -4,8 +4,8 @@ values:
4
4
  2022-01-01: 268.421 # 2021Q3: (267.789 + 268.387 + 269.086) / 3
5
5
  2023-01-01: 291.901 # 2022Q3: (292.219 + 291.629 + 291.854) / 3
6
6
  2024-01-01: 301.236 # 2023Q3: (299.899 + 301.551 + 302.257) / 3
7
+ 2025-01-01: 308.767 # 2024Q3: 2.5% COLA announced by SSA
7
8
  # Forecasts from marrying CPI-W actuals with CBO's CPI-U forecast.
8
- 2025-01-01: 310.866 # 2024Q3: 315.6 * 306.199 / 310.989
9
9
  2026-01-01: 318.155 # 2025Q3: 323.0 * 306.199 / 310.989
10
10
  2027-01-01: 326.149 # 2026Q3: 330.1 * 306.199 / 310.989
11
11
  2028-01-01: 332.241 # 2027Q3: 337.3 * 306.199 / 310.989
@@ -16,10 +16,13 @@ values:
16
16
  2033-01-01: 370.656 # 2032Q3: 376.3 * 306.199 / 310.989
17
17
  2034-01-01: 379.028 # 2033Q3: 384.8 * 306.199 / 310.989
18
18
  2035-01-01: 387.598 # 2034Q3: 393.5 * 306.199 / 310.989
19
+ # Values for 2036-2100 are set programmatically in uprating_extensions.py
19
20
  metadata:
21
+ economy: false
20
22
  unit: currency-USD
21
23
  label: SSA uprating
22
- economy: false
23
24
  reference:
24
- - title: Social Security Latest Cost-of-Living Adjustments
25
- href: https://www.ssa.gov/oact/cola/latestCOLA.html
25
+ - title: Historical values
26
+ href: https://www.ssa.gov/oact/cola/colaseries.html
27
+ - title: CBO Economic Projections, February 2024.
28
+ href: https://www.cbo.gov/publication/59710
@@ -17,6 +17,7 @@ values:
17
17
  2032-10-01: 374.3 # 2032Q2
18
18
  2033-10-01: 382.7 # 2033Q2
19
19
  2034-10-01: 391.3 # 2034Q2
20
+ # Values for 2035-2100 are set programmatically in uprating.py
20
21
  metadata:
21
22
  unit: currency-USD
22
23
  label: SNAP uprating
@@ -0,0 +1,144 @@
1
+ """Unified script to extend all uprating factors through 2100."""
2
+
3
+ from policyengine_us.model_api import *
4
+ from policyengine_core.periods import instant
5
+
6
+
7
+ def get_irs_cpi(parameters: ParameterNode, year: int) -> float:
8
+ """Calculate IRS CPI based on Chained CPI-U average from Sep to Aug."""
9
+ cpi = parameters.gov.bls.cpi.c_cpi_u
10
+ end = instant(f"{year}-08-01")
11
+ start = end.offset(-MONTHS_IN_YEAR, MONTH)
12
+ monthly_cpi_values = []
13
+ for month in range(MONTHS_IN_YEAR):
14
+ monthly_cpi_values += [cpi(start.offset(month, MONTH))]
15
+ return sum(monthly_cpi_values) / MONTHS_IN_YEAR
16
+
17
+
18
+ def extend_parameter_values(
19
+ parameter: Parameter,
20
+ last_projected_year: int,
21
+ end_year: int,
22
+ period_month: int = 1,
23
+ period_day: int = 1,
24
+ ) -> None:
25
+ """
26
+ Extend a parameter's values from last_projected_year to end_year using
27
+ the growth rate from the last two years of projections.
28
+
29
+ Args:
30
+ parameter: The parameter to extend
31
+ last_projected_year: The last year with actual/projected values
32
+ end_year: The year to extend values through
33
+ period_month: The month for the period (default 1 for January)
34
+ period_day: The day for the period (default 1)
35
+ """
36
+ # Calculate the growth rate from the last two years of projections
37
+ date_format = f"-{period_month:02d}-{period_day:02d}"
38
+ second_to_last_value = parameter(f"{last_projected_year - 1}{date_format}")
39
+ last_value = parameter(f"{last_projected_year}{date_format}")
40
+ growth_rate = last_value / second_to_last_value
41
+
42
+ # Apply growth rate for years beyond projections
43
+ for year in range(last_projected_year + 1, end_year + 1):
44
+ previous_value = parameter(f"{year - 1}{date_format}")
45
+ new_value = previous_value * growth_rate
46
+ parameter.update(period=f"year:{year}{date_format}:1", value=new_value)
47
+
48
+ # Set the final value for periods after the last year
49
+ final_value = parameter(f"{end_year}{date_format}")
50
+ parameter.update(
51
+ start=instant(f"{end_year}{date_format}"), value=final_value
52
+ )
53
+
54
+
55
+ def set_all_uprating_parameters(parameters: ParameterNode) -> ParameterNode:
56
+ """
57
+ Extend all uprating parameters through 2100.
58
+
59
+ This function programmatically extends various uprating factors used
60
+ throughout the US tax and benefit system, including:
61
+ - IRS uprating (based on Chained CPI-U)
62
+ - SNAP uprating (October values)
63
+ - SSA uprating (January values)
64
+ - HHS poverty guideline uprating (January values)
65
+ """
66
+ END_YEAR = 2100
67
+
68
+ # IRS uprating - special case that computes from CPI
69
+ IRS_UPRATING_START_YEAR = 2010
70
+ IRS_LAST_PROJECTED_YEAR = 2035
71
+
72
+ uprating_index = parameters.gov.irs.uprating
73
+
74
+ # Calculate the growth rate from the last two years of CPI projections
75
+ cpi_second_to_last = get_irs_cpi(parameters, IRS_LAST_PROJECTED_YEAR - 2)
76
+ cpi_last = get_irs_cpi(parameters, IRS_LAST_PROJECTED_YEAR - 1)
77
+ growth_rate = cpi_last / cpi_second_to_last
78
+
79
+ # Apply IRS uprating
80
+ for year in range(IRS_UPRATING_START_YEAR, END_YEAR + 1):
81
+ if year <= IRS_LAST_PROJECTED_YEAR:
82
+ # Use actual CPI values through the last projected year
83
+ irs_cpi = get_irs_cpi(parameters, year - 1)
84
+ else:
85
+ # For all years after LAST_PROJECTED_YEAR, apply the constant growth rate
86
+ irs_cpi = uprating_index(f"{year - 1}-01-01") * growth_rate
87
+ uprating_index.update(period=f"year:{year}-01-01:1", value=irs_cpi)
88
+ uprating_index.update(start=instant(f"{END_YEAR}-01-01"), value=irs_cpi)
89
+
90
+ # SNAP uprating (October values, last projection year 2034)
91
+ extend_parameter_values(
92
+ parameters.gov.usda.snap.uprating,
93
+ last_projected_year=2034,
94
+ end_year=END_YEAR,
95
+ period_month=10,
96
+ period_day=1,
97
+ )
98
+
99
+ # SSA uprating (January values, last projection year 2035)
100
+ extend_parameter_values(
101
+ parameters.gov.ssa.uprating,
102
+ last_projected_year=2035,
103
+ end_year=END_YEAR,
104
+ period_month=1,
105
+ period_day=1,
106
+ )
107
+
108
+ # HHS poverty guideline uprating (January values, last projection year 2035)
109
+ extend_parameter_values(
110
+ parameters.gov.hhs.uprating,
111
+ last_projected_year=2035,
112
+ end_year=END_YEAR,
113
+ period_month=1,
114
+ period_day=1,
115
+ )
116
+
117
+ # CPI-U (February values, last projection year 2034)
118
+ extend_parameter_values(
119
+ parameters.gov.bls.cpi.cpi_u,
120
+ last_projected_year=2034,
121
+ end_year=END_YEAR,
122
+ period_month=2,
123
+ period_day=1,
124
+ )
125
+
126
+ # Chained CPI-U (February values, last projection year 2034)
127
+ extend_parameter_values(
128
+ parameters.gov.bls.cpi.c_cpi_u,
129
+ last_projected_year=2034,
130
+ end_year=END_YEAR,
131
+ period_month=2,
132
+ period_day=1,
133
+ )
134
+
135
+ # CPI-W (February values, last projection year 2034)
136
+ extend_parameter_values(
137
+ parameters.gov.bls.cpi.cpi_w,
138
+ last_projected_year=2034,
139
+ end_year=END_YEAR,
140
+ period_month=2,
141
+ period_day=1,
142
+ )
143
+
144
+ return parameters
@@ -0,0 +1,21 @@
1
+ - name: Basic case
2
+ period: 2024
3
+ input:
4
+ eitc: 2_000
5
+ uncapped_ssi: 1_000
6
+ pr_refundable_ctc_social_security_tax: 6_600
7
+ refundable_ctc: 2_800
8
+ ctc: 3_000
9
+ output:
10
+ pr_refundable_ctc: 3_000
11
+
12
+ - name: Uncapped SSI below 0
13
+ period: 2024
14
+ input:
15
+ eitc: 1_000
16
+ uncapped_ssi: -1_000
17
+ pr_refundable_ctc_social_security_tax: 500
18
+ refundable_ctc: 2_000
19
+ ctc: 1_000
20
+ output:
21
+ pr_refundable_ctc: 1_000
@@ -0,0 +1,108 @@
1
+ """Test unified uprating extensions through 2100."""
2
+
3
+
4
+ def test_all_uprating_factors_extend_to_2100():
5
+ """Test that all uprating factors extend through 2100 with consistent growth rates."""
6
+ from policyengine_us import Microsimulation
7
+
8
+ sim = Microsimulation()
9
+ parameters = sim.tax_benefit_system.parameters
10
+
11
+ # Define all uprating parameters to test with their specific periods
12
+ uprating_params = [
13
+ ("IRS", parameters.gov.irs.uprating, "-01-01"),
14
+ ("SNAP", parameters.gov.usda.snap.uprating, "-10-01"),
15
+ ("SSA", parameters.gov.ssa.uprating, "-01-01"),
16
+ ("HHS", parameters.gov.hhs.uprating, "-01-01"),
17
+ ("CPI-U", parameters.gov.bls.cpi.cpi_u, "-02-01"),
18
+ ("Chained CPI-U", parameters.gov.bls.cpi.c_cpi_u, "-02-01"),
19
+ ("CPI-W", parameters.gov.bls.cpi.cpi_w, "-02-01"),
20
+ ]
21
+
22
+ for name, param, date_suffix in uprating_params:
23
+ # Test that values exist and are positive for future years
24
+ test_years = [2035, 2050, 2075, 2100]
25
+ values = []
26
+
27
+ for year in test_years:
28
+ value = param(f"{year}{date_suffix}")
29
+ assert (
30
+ value > 0
31
+ ), f"No positive {name} uprating value for year {year}"
32
+ values.append(value)
33
+
34
+ # Test that values are monotonically increasing
35
+ for i in range(1, len(values)):
36
+ assert (
37
+ values[i] > values[i - 1]
38
+ ), f"{name} uprating should increase from {test_years[i-1]} to {test_years[i]}"
39
+
40
+ # Test that growth is consistent in the extended period
41
+ # Use years after the projection period ends
42
+ year1, year2, year3 = 2040, 2041, 2042
43
+ val1 = param(f"{year1}{date_suffix}")
44
+ val2 = param(f"{year2}{date_suffix}")
45
+ val3 = param(f"{year3}{date_suffix}")
46
+
47
+ growth_rate_1 = val2 / val1
48
+ growth_rate_2 = val3 / val2
49
+
50
+ # Growth rates should be approximately equal (within 0.1%)
51
+ assert (
52
+ abs(growth_rate_1 - growth_rate_2) < 0.001
53
+ ), f"{name} growth rate should be consistent: {growth_rate_1:.5f} vs {growth_rate_2:.5f}"
54
+
55
+
56
+ def test_uprating_growth_rates_are_reasonable():
57
+ """Test that all uprating growth rates are within reasonable bounds."""
58
+ from policyengine_us import Microsimulation
59
+
60
+ sim = Microsimulation()
61
+ parameters = sim.tax_benefit_system.parameters
62
+
63
+ # Annual growth rates should be between 0.5% and 5% for inflation measures
64
+ min_annual_growth = 1.005
65
+ max_annual_growth = 1.05
66
+
67
+ # Test all uprating parameters
68
+ uprating_params = [
69
+ ("IRS", parameters.gov.irs.uprating, "-01-01"),
70
+ ("SNAP", parameters.gov.usda.snap.uprating, "-10-01"),
71
+ ("SSA", parameters.gov.ssa.uprating, "-01-01"),
72
+ ("HHS", parameters.gov.hhs.uprating, "-01-01"),
73
+ ("CPI-U", parameters.gov.bls.cpi.cpi_u, "-02-01"),
74
+ ("Chained CPI-U", parameters.gov.bls.cpi.c_cpi_u, "-02-01"),
75
+ ("CPI-W", parameters.gov.bls.cpi.cpi_w, "-02-01"),
76
+ ]
77
+
78
+ year1, year2 = 2050, 2051
79
+
80
+ for name, param, date_suffix in uprating_params:
81
+ value_year1 = param(f"{year1}{date_suffix}")
82
+ value_year2 = param(f"{year2}{date_suffix}")
83
+ growth_rate = value_year2 / value_year1
84
+
85
+ assert (
86
+ min_annual_growth <= growth_rate <= max_annual_growth
87
+ ), f"{name} growth rate {growth_rate:.4f} outside reasonable bounds [{min_annual_growth:.3f}, {max_annual_growth:.3f}]"
88
+
89
+
90
+ def test_cpi_relationships():
91
+ """Test that CPI indices maintain expected relationships."""
92
+ from policyengine_us import Microsimulation
93
+
94
+ sim = Microsimulation()
95
+ parameters = sim.tax_benefit_system.parameters
96
+
97
+ # Test a few years to ensure relationships are maintained
98
+ test_years = [2040, 2060, 2080, 2100]
99
+
100
+ for year in test_years:
101
+ cpi_u = parameters.gov.bls.cpi.cpi_u(f"{year}-02-01")
102
+ c_cpi_u = parameters.gov.bls.cpi.c_cpi_u(f"{year}-02-01")
103
+
104
+ # Chained CPI-U typically grows slower than regular CPI-U
105
+ # due to substitution effects, but not always
106
+ # Just verify both exist and are positive
107
+ assert cpi_u > 0, f"CPI-U should be positive in {year}"
108
+ assert c_cpi_u > 0, f"Chained CPI-U should be positive in {year}"
@@ -14,6 +14,6 @@ class pr_low_income_credit_eligible(Variable):
14
14
  eligible_people = tax_unit(
15
15
  "pr_low_income_credit_eligible_people", period
16
16
  )
17
- income = tax_unit("pr_gross_income", period)
17
+ income = tax_unit("pr_gross_income_person", period)
18
18
  income_limit = p.income_limit.calc(eligible_people)
19
19
  return income <= income_limit
@@ -0,0 +1,34 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class pr_refundable_ctc(Variable):
5
+ value_type = float
6
+ entity = TaxUnit
7
+ label = "Puerto Rico refundable Child Tax Credit"
8
+ unit = USD
9
+ definition_period = YEAR
10
+ reference = (
11
+ "https://www.irs.gov/pub/irs-pdf/f1040s8.pdf"
12
+ "https://www.law.cornell.edu/uscode/text/26/24#h_4_A"
13
+ )
14
+
15
+ # This provision is part of the federal CTC legal code
16
+ # will will merge the logic with the federal CTC once the puerto income tax structure is completed
17
+ def formula(tax_unit, period, parameters):
18
+ # line 24
19
+ # uncapped_ssi can be below 0
20
+ ssi = max_(0, add(tax_unit, period, ["uncapped_ssi"]))
21
+ sum_eitc_ssi = add(tax_unit, period, ["eitc"]) + ssi
22
+
23
+ # line 25
24
+ reduced_ss_tax = max_(
25
+ 0,
26
+ tax_unit("pr_refundable_ctc_social_security_tax", period)
27
+ - sum_eitc_ssi,
28
+ )
29
+
30
+ # line 26
31
+ base_credit = max_(tax_unit("refundable_ctc", period), reduced_ss_tax)
32
+
33
+ # line 27
34
+ return min_(base_credit, tax_unit("ctc", period))
@@ -0,0 +1,16 @@
1
+ from policyengine_us.model_api import *
2
+
3
+
4
+ class pr_refundable_ctc_social_security_tax(Variable):
5
+ value_type = float
6
+ entity = TaxUnit
7
+ label = "Puerto Rico social security and medicare taxes for refundable Child Tax Credit"
8
+ unit = USD
9
+ definition_period = YEAR
10
+ reference = (
11
+ "https://www.irs.gov/pub/irs-pdf/f1040s8.pdf"
12
+ "https://www.law.cornell.edu/uscode/text/26/24#h_4_A"
13
+ )
14
+
15
+ # line 23
16
+ adds = "gov.irs.credits.ctc.refundable.social_security.add"
@@ -4,7 +4,7 @@ from policyengine_us.model_api import *
4
4
  class pr_gross_income_person(Variable):
5
5
  value_type = float
6
6
  entity = Person
7
- label = "Puerto Rico gross income person"
7
+ label = "Puerto Rico gross income"
8
8
  unit = USD
9
9
  definition_period = YEAR
10
10
  defined_for = StateCode.PR
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: policyengine-us
3
- Version: 1.371.0
3
+ Version: 1.373.0
4
4
  Summary: Add your description here.
5
5
  Author-email: PolicyEngine <hello@policyengine.org>
6
6
  License-File: LICENSE
@@ -8,6 +8,7 @@ policyengine_us/typing.py,sha256=ixLAOFjSnepNEAZ63DhhBZHRw0rBgjH81y_z4hTjhEE,298
8
8
  policyengine_us/data/__init__.py,sha256=TuwzfG1RS1KzvMptMbpbEfiaRG5RPCXQK5gYBwzDkBc,47
9
9
  policyengine_us/data/zip_code_dataset.py,sha256=PvA4Jldyu21XEuJMGRAcNLxjlJnDSJ7iVTBdy2c1Mp8,337
10
10
  policyengine_us/parameters/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
11
+ policyengine_us/parameters/uprating_extensions.py,sha256=qK945oDjs2UxHVg5fWkVISghsaaqoDk0h_WRxN01hug,5070
11
12
  policyengine_us/parameters/calibration/gov/aca/enrollment/state.yaml,sha256=NjN2M7pJxG6q78KR3-I3cIZCVjDayrswc65RISZmetY,1794
12
13
  policyengine_us/parameters/calibration/gov/aca/spending/state.yaml,sha256=1kvJIiu-cYEbXPAaBQcOqSE3ShXfALag-1Pdw3sdEes,2018
13
14
  policyengine_us/parameters/calibration/gov/cbo/income_by_source.yaml,sha256=xuzSBHECTYR7XwFhVgNrAOy1ffEUO2W0mo6g3MzwU24,6719
@@ -106,9 +107,9 @@ policyengine_us/parameters/gov/aca/slcsp/max_child_age.yaml,sha256=H0zXuEv7vVUxd
106
107
  policyengine_us/parameters/gov/aca/spending/state.yaml,sha256=1kvJIiu-cYEbXPAaBQcOqSE3ShXfALag-1Pdw3sdEes,2018
107
108
  policyengine_us/parameters/gov/bls/README.md,sha256=mvQn4hzE0XxaeeC-1ifo6jfCYly_3kXBpGAOHIFtrEo,35
108
109
  policyengine_us/parameters/gov/bls/cpi/README.md,sha256=ch6EGah8vqYgD4eOPb5NaKp8jD8U00JG5_NxvgrHm-8,29
109
- policyengine_us/parameters/gov/bls/cpi/c_cpi_u.yaml,sha256=fdV3E6PLxo9zRwZOQKbbeZ4jUwkyhMephWr1oiehMbs,7833
110
- policyengine_us/parameters/gov/bls/cpi/cpi_u.yaml,sha256=mcbi7y9fPG9mFj2KsCtGV-bW5ViYStGajB2o4JzJnHI,27923
111
- policyengine_us/parameters/gov/bls/cpi/cpi_w.yaml,sha256=ukBM2hvO8Y81-FlelLf1_raJtfFMLqeiEgfdaoY0Mok,30011
110
+ policyengine_us/parameters/gov/bls/cpi/c_cpi_u.yaml,sha256=ahXQdHFJG4QTdG1PduWEwX9qeIfSy8Trb7KUKNLp_HQ,7671
111
+ policyengine_us/parameters/gov/bls/cpi/cpi_u.yaml,sha256=tpi1qDrQC-Kl8tkQzn5gj17l-59gYTu-6cyzqpq94MQ,27737
112
+ policyengine_us/parameters/gov/bls/cpi/cpi_w.yaml,sha256=Aiv9SIifEtIXEtNpNMWOFz3ELZ0nAJ4dsyaZE3oGmO4,29153
112
113
  policyengine_us/parameters/gov/contrib/README.md,sha256=6ug3-8sV30Mlz4uVQbO2nsQ3X0BfLRGpjRPXuD4aUkM,14
113
114
  policyengine_us/parameters/gov/contrib/dc_tax_threshold_joint_ratio.yaml,sha256=t-x2bZHeltkqwVZJXrMCOrqCSrRRzUunDOXBIgqAw6w,164
114
115
  policyengine_us/parameters/gov/contrib/additional_tax_bracket/bracket.yaml,sha256=QWzfPBK2MwVkNTaH_6q5ebdqanPdIB56iQepvKbKT5A,23686
@@ -360,7 +361,7 @@ policyengine_us/parameters/gov/fcc/lifeline/amount/standard.yaml,sha256=i94DV8Ow
360
361
  policyengine_us/parameters/gov/hhs/README.md,sha256=-K3nU8bLJDb5t222i9zQRp2LOhpqtszN_7-Zfi_3PH0,48
361
362
  policyengine_us/parameters/gov/hhs/fpg.yaml,sha256=O0GRTHiNjLvpS1kJBZRg5dZtDUwgijEJBZd9qpvp7nM,2619
362
363
  policyengine_us/parameters/gov/hhs/index.yaml,sha256=diih4UjZz-5dZSiO89js5pJ-G3PO3kWspE7ybH4kCqk,66
363
- policyengine_us/parameters/gov/hhs/uprating.yaml,sha256=CgiBGfZiYVPkGIhyBNDrKeXDBoOR_-LevCzUESEK8qg,1082
364
+ policyengine_us/parameters/gov/hhs/uprating.yaml,sha256=wy33MD3JtpWBCnq6aBjIA7ba-UjGmKCGgbDTxL9es6s,1148
364
365
  policyengine_us/parameters/gov/hhs/ccdf/README.md,sha256=5u4-bwFTCDWgj6711QBPRQMoJSUfXBp_o_1UTxITl8Y,37
365
366
  policyengine_us/parameters/gov/hhs/ccdf/age_limit.yaml,sha256=f4owI4F6qjaNtyZsjDwFXCfISEISR_piAjqxddc3fi0,293
366
367
  policyengine_us/parameters/gov/hhs/ccdf/amount.yaml,sha256=2a8QXjkSjyzj1lsAgno79XU8fngz8YpMxw0xAvp8QSA,17822
@@ -467,7 +468,7 @@ policyengine_us/parameters/gov/hud/total_tenant_payment/adjusted_income_share.ya
467
468
  policyengine_us/parameters/gov/hud/total_tenant_payment/income_share.yaml,sha256=9QlMKL43trmMBjsOCns9FTgpqonf3jyuTNsJ4wkOu1c,252
468
469
  policyengine_us/parameters/gov/hud/total_tenant_payment/index.yaml,sha256=rHA75ZOkRKkoYkd4zjChiGfJF_G--G2ZfwG3LZLIf6I,85
469
470
  policyengine_us/parameters/gov/irs/README.md,sha256=xVPG5PdyT2rCqyo7FYIWJh2RGmYi2iQg-4OM8tGnvuQ,33
470
- policyengine_us/parameters/gov/irs/uprating.py,sha256=50BDVFZFOIpITiaqWUW9wVvWKM3stWIullONY8m6KJA,1039
471
+ policyengine_us/parameters/gov/irs/uprating.py,sha256=jiteQOplsLRbiSw9AR53ZVnf5tPLNCips04jvC6UKA4,438
471
472
  policyengine_us/parameters/gov/irs/uprating.yaml,sha256=eWHiY-KVTNKaH4ls-TG0I9ZWX2T46x0kaTY-w55YLzA,167
472
473
  policyengine_us/parameters/gov/irs/ald/README.md,sha256=W2ghpaFkMCePzJkUcylIX_glYWcTGV4Cm_pfqU50JPE,28
473
474
  policyengine_us/parameters/gov/irs/ald/deductions.yaml,sha256=uRpDXeDB3DeGkXbmbW2VE1LOvvnzPdnLldXbpdpKgcY,2202
@@ -847,7 +848,7 @@ policyengine_us/parameters/gov/simulation/labor_supply_responses/elasticities/in
847
848
  policyengine_us/parameters/gov/simulation/labor_supply_responses/elasticities/substitution.yaml,sha256=q3b4i70HTPpRPbKU95QCRxL0wVxzi9_PRqDhGznd7Cs,1869
848
849
  policyengine_us/parameters/gov/ssa/README.md,sha256=Rcxn6NYTRCJYhktw0-I4QxgcDsYYsqCKabBb7EJq4gw,39
849
850
  policyengine_us/parameters/gov/ssa/nawi.yaml,sha256=Dbb8NPv7AEmaKPhHgDsWA5D54Q2aJPkr0OSccgDR4bw,4197
850
- policyengine_us/parameters/gov/ssa/uprating.yaml,sha256=orf6KApySVUInjaGI2XlAM9WU8bUzkWS8cihOillIxk,1298
851
+ policyengine_us/parameters/gov/ssa/uprating.yaml,sha256=qR8giFlpvxYxaeOopHqy8BiGT1OQQEz2X09elmbLNl4,1447
851
852
  policyengine_us/parameters/gov/ssa/sga/READme.md,sha256=hQy92h15bvMGYcm66GgW2Q9S-dKjw3JAREixpeoIg4g,31
852
853
  policyengine_us/parameters/gov/ssa/sga/blind.yaml,sha256=Rta-kqpG9JNIwTOE7B35sM5IMHsF2yBYPmF4_ILuSBw,599
853
854
  policyengine_us/parameters/gov/ssa/sga/non_blind.yaml,sha256=6_3Rt5PEh66K7HJk1APn21cMo0xXBUKnF49o8RPifK8,1189
@@ -2996,7 +2997,7 @@ policyengine_us/parameters/gov/usda/snap/categorical_eligibility.yaml,sha256=P0R
2996
2997
  policyengine_us/parameters/gov/usda/snap/expected_contribution.yaml,sha256=G_KHyiV2FlSVEvbM50p4M9c1MqqRRxWXMWI0dD8QGNk,266
2997
2998
  policyengine_us/parameters/gov/usda/snap/max_allotment.yaml,sha256=ggXp6e-H_sLHTQEAn5-eFhh_h9rnN-iENMiQhZ8Ya3s,12065
2998
2999
  policyengine_us/parameters/gov/usda/snap/takeup_rate.yaml,sha256=7vhUcW-vYntaCgMDtUTejOLFIwB09DL8OXgF4XSpUZg,260
2999
- policyengine_us/parameters/gov/usda/snap/uprating.yaml,sha256=_MGg3_6AmfXf3h3nNDsijF0y58XCXCwl5D0w8Ix_vv8,963
3000
+ policyengine_us/parameters/gov/usda/snap/uprating.yaml,sha256=1IaszxANNLlV8niyVYmB1G7Y1tLaehRt3mMbelDDYuI,1028
3000
3001
  policyengine_us/parameters/gov/usda/snap/asset_test/limit.yaml,sha256=_50BAmu84RumiXPCgCM4YBjV2drD15QzwQX38A0lhww,3013
3001
3002
  policyengine_us/parameters/gov/usda/snap/emergency_allotment/allowed.yaml,sha256=F3wNVVVYi7YZ6R0i73854Dco26REbhMEfpy9HzpdYpw,631
3002
3003
  policyengine_us/parameters/gov/usda/snap/emergency_allotment/in_effect.yaml,sha256=scGNcKkui593vmvpQtKr7X6rR1r7QeZTQvIHLvmfByo,2155
@@ -4944,6 +4945,7 @@ policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/credits/low_
4944
4945
  policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit.yaml,sha256=pNbfl-WLMHos8cKr-J50F2ZqOZt-ovYCdY30lyEKBrU,1984
4945
4946
  policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit_eligible.yaml,sha256=WyIHPu6ZH0xYYJeCNsQnDktz0ywJWDfAj3FMbyRMFJg,1950
4946
4947
  policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit_eligible_person.yaml,sha256=EAipNZfTMVye2BdYodTgAtJtWjzR7UTaGK-R8k3qvB0,813
4948
+ policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/credits/refundable_ctc/pr_refundable_ctc.yaml,sha256=DMuJebsPv9PASlRSV3iq3ZTyAZZlO78XBsOYrXTaVog,433
4947
4949
  policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/taxable_income/deductions/pr_casualty_loss_deduction.yaml,sha256=FteN_CqJcr_hjNt0BPagZ5bI9i4PwpHa4vCvphQ-FkY,333
4948
4950
  policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/taxable_income/deductions/pr_charitable_deduction.yaml,sha256=W6N5RCKT6iKoV6qr_UbdrVmsy8c7NZkIRR-GqDV_oiM,470
4949
4951
  policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/taxable_income/deductions/pr_medical_expense_deduction.yaml,sha256=0swPOBL6tTh5Q2ScDziSdgFBQHmd2m8yutElgjfDHss,897
@@ -5097,6 +5099,7 @@ policyengine_us/tests/policy/baseline/household/income/spm_unit/spm_unit_market_
5097
5099
  policyengine_us/tests/policy/baseline/household/income/spm_unit/spm_unit_net_income.yaml,sha256=lZorN8LQYPCNpHDriLdLbaJ8vg3kHHK_UIVcbo7tkdk,218
5098
5100
  policyengine_us/tests/policy/baseline/household/income/tax_unit/spouse_separate_adjusted_gross_income.yaml,sha256=zNhFBR3IFmCJjnScfTvpVfmUv3Xl-yIXKlFA3pNjwsg,373
5099
5101
  policyengine_us/tests/policy/baseline/income/spm_unit_income_decile.yaml,sha256=1wLKnDqXKVBadZKYVGYlA1NpsS8VgHAlnV9JU97IRf4,1263
5102
+ policyengine_us/tests/policy/baseline/parameters/test_uprating_extensions.py,sha256=HVscmchTdhGQZDtIcPezVgQ8zc2b-7WVh8nQ07QcfQc,4253
5100
5103
  policyengine_us/tests/policy/contrib/dc_kccatc.yaml,sha256=v4woAJveF3mZH6d4W3xAYlejcTIHTEQZM4nnenGNq-8,1786
5101
5104
  policyengine_us/tests/policy/contrib/dc_single_joint_threshold_ratio.yaml,sha256=vDMmkKdvjCtR8uweKDptp1gt05OI78Pm7GoIL0Apxxg,632
5102
5105
  policyengine_us/tests/policy/contrib/reported_state_income_tax.yaml,sha256=697RFAYWbmvD4LdQA-RHnIJ8nuu9wwEc2IRejdJ4QAQ,232
@@ -7670,7 +7673,7 @@ policyengine_us/variables/gov/states/wv/tax/income/subtractions/social_security/
7670
7673
  policyengine_us/variables/gov/territories/pr/tax/income/pr_agi.py,sha256=yqLyP6w4mvABXqLIKECZ4lHI9OetLpgqN-0hbvYl51s,360
7671
7674
  policyengine_us/variables/gov/territories/pr/tax/income/pr_agi_person.py,sha256=gveEdwFLkTFd_76v_mHGK47tXrozNwtoNTS4bNif_h0,379
7672
7675
  policyengine_us/variables/gov/territories/pr/tax/income/pr_gross_income.py,sha256=P2Mn2tUhrnP2LsIx4P0OFz67oo6t9NKZKpKCzqb1RLc,399
7673
- policyengine_us/variables/gov/territories/pr/tax/income/pr_gross_income_person.py,sha256=OOPk4gvnNKClaS8TAAZbGOqHSS8Z31to1m8rj9ALdb0,438
7676
+ policyengine_us/variables/gov/territories/pr/tax/income/pr_gross_income_person.py,sha256=SFZtLDY2V-a1qH8p_EvIvOYhUsH_cjhHJBWYnmBB3jU,431
7674
7677
  policyengine_us/variables/gov/territories/pr/tax/income/credits/pr_refundable_credits.py,sha256=-Vxk6bPiB9tSwDOIE46Q3LNLBMKL-3atTYPBD3SfC_Y,308
7675
7678
  policyengine_us/variables/gov/territories/pr/tax/income/credits/earned_income/pr_earned_income_credit.py,sha256=-magFQVK47xuu0D3PleHiy_ihbx4RdJW-Jg_ELQO0Ks,1851
7676
7679
  policyengine_us/variables/gov/territories/pr/tax/income/credits/earned_income/pr_earned_income_credit_eligible.py,sha256=ilQSYlQ6cEQuf4oHHnhHWRGywxkzN5Y6GOhu9_FwmqI,630
@@ -7678,9 +7681,11 @@ policyengine_us/variables/gov/territories/pr/tax/income/credits/earned_income/pr
7678
7681
  policyengine_us/variables/gov/territories/pr/tax/income/credits/earned_income/pr_earned_income_credit_unearned_income.py,sha256=_9ms1IMxdZyhOUv9fJ0VG0tCGosl0n-YYxkpiU-h0d0,597
7679
7682
  policyengine_us/variables/gov/territories/pr/tax/income/credits/low_income/pr_compensatory_low_income_credit.py,sha256=x-qB-_buWpRMY_YzINM7dhkm37AUY5M4-8-KWHFecKA,869
7680
7683
  policyengine_us/variables/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit.py,sha256=oJvrGUz1SeOVYpFBlyNr6SHCtuPCGEyKvs02gCsBjXA,873
7681
- policyengine_us/variables/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit_eligible.py,sha256=PDHESn5D7AzJLcwJ6_hQOOANqWHygRsYenJVtY5JPEU,977
7684
+ policyengine_us/variables/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit_eligible.py,sha256=4Z_1zqwupW-5vdIsUGxswGp58xdqzwsym70-JiHKWPk,984
7682
7685
  policyengine_us/variables/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit_eligible_people.py,sha256=RgzLpArMyaF5UDGwETViRUku4FHCAfnez_zMWi5g_ek,628
7683
7686
  policyengine_us/variables/gov/territories/pr/tax/income/credits/low_income/pr_low_income_credit_eligible_person.py,sha256=AyYkgYDtaroJZuAi-uO9hXarBKhgMMXvmsMGf2Nqp5Q,1107
7687
+ policyengine_us/variables/gov/territories/pr/tax/income/credits/refundable_ctc/pr_refundable_ctc.py,sha256=XyjYvfdudRP3DMfCsmhmpqUaRH00gQpjTy86xrhoW1U,1097
7688
+ policyengine_us/variables/gov/territories/pr/tax/income/credits/refundable_ctc/pr_refundable_ctc_social_security_tax.py,sha256=pVjsUPcD-QUXWTniQgla4e7rSfkTztuOHgxR42DHmD8,497
7684
7689
  policyengine_us/variables/gov/territories/pr/tax/income/taxable_income/deductions/pr_casualty_loss_deduction.py,sha256=g2QRdt75GmxRZSuzU_9c_uvAjCKXSXQMEACzarVPrAU,886
7685
7690
  policyengine_us/variables/gov/territories/pr/tax/income/taxable_income/deductions/pr_charitable_deduction.py,sha256=2u9YAoBduN8NKKKSzpWy06wVk5QbAbxj6Tp9bOCtn2o,848
7686
7691
  policyengine_us/variables/gov/territories/pr/tax/income/taxable_income/deductions/pr_medical_expense_deduction.py,sha256=5U77mChDcF3XOpHujLInWcdboU_JDy7wN64_p33eZRA,743
@@ -8256,8 +8261,8 @@ policyengine_us/variables/input/farm_income.py,sha256=BEKxYmHNNnWJAAvULl5qZJigy5
8256
8261
  policyengine_us/variables/input/geography.py,sha256=XmBlgXhzBoLRKk6R8taVZHqUw1eU8MbNeGS9iJ7_l44,4506
8257
8262
  policyengine_us/variables/input/self_employment_income.py,sha256=PwsGz8R4lRikKWUYOhsC0qosNNLXq4f5SQmfw4S3mk8,511
8258
8263
  policyengine_us/variables/input/self_employment_income_before_lsr.py,sha256=E8fcX9Nlyqz8dziHhQv_euutdmoIwFMMWePUwbbwv_w,379
8259
- policyengine_us-1.371.0.dist-info/METADATA,sha256=XfoMzgh5DHEG1JW62c_h2KTYb4SGrlpnm0NKQ3eo9JY,1649
8260
- policyengine_us-1.371.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8261
- policyengine_us-1.371.0.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
8262
- policyengine_us-1.371.0.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
8263
- policyengine_us-1.371.0.dist-info/RECORD,,
8264
+ policyengine_us-1.373.0.dist-info/METADATA,sha256=KPzfVghqHrLGG0miQZufkw5GLa1jZOifq9iwV3w9ljY,1649
8265
+ policyengine_us-1.373.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8266
+ policyengine_us-1.373.0.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
8267
+ policyengine_us-1.373.0.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
8268
+ policyengine_us-1.373.0.dist-info/RECORD,,