policyengine-us 1.365.0__py3-none-any.whl → 1.365.2__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/states/me/tax/income/credits/dependent_exemption/amount.yaml +1 -1
- policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/multiplier.yaml +22 -0
- policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/phase_out/start.yaml +2 -1
- policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/me_dependent_exemption_credit.yaml +86 -6
- policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/me_dependent_exemption_credit_amount_person.yaml +29 -0
- policyengine_us/tests/utilities/test_ucgid_hierarchical.py +68 -5
- policyengine_us/variables/gov/states/me/tax/income/credits/dependent_exemption/me_dependent_exemption_credit.py +3 -3
- policyengine_us/variables/gov/states/me/tax/income/credits/dependent_exemption/me_dependent_exemption_credit_amount_person.py +20 -0
- policyengine_us/variables/household/demographic/geographic/ucgid/ucgid.py +68 -71
- policyengine_us/variables/household/demographic/geographic/ucgid/ucgid_str.py +18 -1
- {policyengine_us-1.365.0.dist-info → policyengine_us-1.365.2.dist-info}/METADATA +1 -1
- {policyengine_us-1.365.0.dist-info → policyengine_us-1.365.2.dist-info}/RECORD +15 -12
- {policyengine_us-1.365.0.dist-info → policyengine_us-1.365.2.dist-info}/WHEEL +0 -0
- {policyengine_us-1.365.0.dist-info → policyengine_us-1.365.2.dist-info}/entry_points.txt +0 -0
- {policyengine_us-1.365.0.dist-info → policyengine_us-1.365.2.dist-info}/licenses/LICENSE +0 -0
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/multiplier.yaml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
description: Maine applies this age-based multiplier to the Dependent Exemption Tax Credit.
|
|
2
|
+
brackets:
|
|
3
|
+
- threshold:
|
|
4
|
+
2018-01-01: 0
|
|
5
|
+
amount:
|
|
6
|
+
2018-01-01: 1
|
|
7
|
+
2025-01-01: 2
|
|
8
|
+
- threshold:
|
|
9
|
+
2018-01-01: 6
|
|
10
|
+
amount:
|
|
11
|
+
2018-01-01: 1
|
|
12
|
+
|
|
13
|
+
metadata:
|
|
14
|
+
type: single_amount
|
|
15
|
+
threshold_unit: year
|
|
16
|
+
amount_unit: /1
|
|
17
|
+
period: year
|
|
18
|
+
label: Maine Dependent Exemption Tax Credit multiplier
|
|
19
|
+
reference:
|
|
20
|
+
# The multiplier was introduced for tax year 2025.
|
|
21
|
+
- title: Maine Fiscal Year 2025 to 2027 Budget Bill (LD 210)
|
|
22
|
+
href: https://legislature.maine.gov/backend/App/services/getDocument.aspx?documentId=120256#page=311
|
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/phase_out/start.yaml
CHANGED
|
@@ -3,7 +3,7 @@ metadata:
|
|
|
3
3
|
unit: currency-USD
|
|
4
4
|
period: year
|
|
5
5
|
label: Maine dependents exemption phase-out start
|
|
6
|
-
|
|
6
|
+
propagate_metadata_to_children: true
|
|
7
7
|
uprating: gov.irs.uprating
|
|
8
8
|
reference:
|
|
9
9
|
- title: Form 1040ME Schedule A (2024) - Worksheet for Dependent Exemption Tax Credit, Line 4
|
|
@@ -26,6 +26,7 @@ metadata:
|
|
|
26
26
|
href: https://legislature.maine.gov/backend/App/services/getDocument.aspx?documentId=120256#page=311
|
|
27
27
|
breakdown:
|
|
28
28
|
- filing_status
|
|
29
|
+
|
|
29
30
|
SINGLE:
|
|
30
31
|
2018-01-01: 200_000
|
|
31
32
|
2025-01-01: 100_000
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
state_code: ME
|
|
5
5
|
me_agi: 450_000
|
|
6
6
|
filing_status: JOINT
|
|
7
|
-
|
|
7
|
+
me_dependent_exemption_credit_amount_person: 600
|
|
8
8
|
output:
|
|
9
9
|
me_dependent_exemption_credit: 225
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
state_code: ME
|
|
15
15
|
me_agi: 449_500
|
|
16
16
|
filing_status: JOINT
|
|
17
|
-
|
|
17
|
+
me_dependent_exemption_credit_amount_person: 600
|
|
18
18
|
output:
|
|
19
19
|
me_dependent_exemption_credit: 225
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
state_code: ME
|
|
25
25
|
me_agi: 450_000
|
|
26
26
|
filing_status: SINGLE
|
|
27
|
-
|
|
27
|
+
me_dependent_exemption_credit_amount_person: 300
|
|
28
28
|
output:
|
|
29
29
|
me_dependent_exemption_credit: 0
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
state_code: ME
|
|
35
35
|
me_agi: 450_000
|
|
36
36
|
filing_status: JOINT
|
|
37
|
-
|
|
37
|
+
me_dependent_exemption_credit_amount_person: 0
|
|
38
38
|
output:
|
|
39
39
|
me_dependent_exemption_credit: 0
|
|
40
40
|
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
state_code: ME
|
|
45
45
|
me_agi: 190_000
|
|
46
46
|
filing_status: SINGLE
|
|
47
|
-
|
|
47
|
+
me_dependent_exemption_credit_amount_person: 600
|
|
48
48
|
output:
|
|
49
49
|
me_dependent_exemption_credit: 600
|
|
50
50
|
|
|
@@ -54,6 +54,86 @@
|
|
|
54
54
|
state_code: ME
|
|
55
55
|
me_agi: 220_000
|
|
56
56
|
filing_status: SINGLE
|
|
57
|
-
|
|
57
|
+
me_dependent_exemption_credit_amount_person: 600
|
|
58
58
|
output:
|
|
59
59
|
me_dependent_exemption_credit: 450
|
|
60
|
+
|
|
61
|
+
- name: Head of Household filer with one older dependent, earning $110,000, gets $300 exemption.
|
|
62
|
+
period: 2025
|
|
63
|
+
input:
|
|
64
|
+
people:
|
|
65
|
+
person1:
|
|
66
|
+
age: 42
|
|
67
|
+
person2:
|
|
68
|
+
age: 8
|
|
69
|
+
ctc_qualifying_child: true
|
|
70
|
+
tax_units:
|
|
71
|
+
tax_unit:
|
|
72
|
+
members: [person1, person2]
|
|
73
|
+
filing_status: HEAD_OF_HOUSEHOLD
|
|
74
|
+
me_agi: 110_000
|
|
75
|
+
households:
|
|
76
|
+
household:
|
|
77
|
+
state_code: ME
|
|
78
|
+
output:
|
|
79
|
+
me_dependent_exemption_credit: 300
|
|
80
|
+
|
|
81
|
+
- name: Head of Household filer with one young dependent, earning $110,000, gets $600 exemption.
|
|
82
|
+
period: 2025
|
|
83
|
+
input:
|
|
84
|
+
people:
|
|
85
|
+
person1:
|
|
86
|
+
age: 42
|
|
87
|
+
person2:
|
|
88
|
+
age: 4
|
|
89
|
+
ctc_qualifying_child: true
|
|
90
|
+
tax_units:
|
|
91
|
+
tax_unit:
|
|
92
|
+
members: [person1, person2]
|
|
93
|
+
filing_status: HEAD_OF_HOUSEHOLD
|
|
94
|
+
me_agi: 110_000
|
|
95
|
+
households:
|
|
96
|
+
household:
|
|
97
|
+
state_code: ME
|
|
98
|
+
output:
|
|
99
|
+
me_dependent_exemption_credit: 600
|
|
100
|
+
|
|
101
|
+
- name: Head of Household filer with one young dependent, earning $132,500, gets $300 exemption.
|
|
102
|
+
period: 2025
|
|
103
|
+
input:
|
|
104
|
+
people:
|
|
105
|
+
person1:
|
|
106
|
+
age: 42
|
|
107
|
+
person2:
|
|
108
|
+
age: 4
|
|
109
|
+
ctc_qualifying_child: true
|
|
110
|
+
tax_units:
|
|
111
|
+
tax_unit:
|
|
112
|
+
members: [person1, person2]
|
|
113
|
+
filing_status: HEAD_OF_HOUSEHOLD
|
|
114
|
+
me_agi: 132_500
|
|
115
|
+
households:
|
|
116
|
+
household:
|
|
117
|
+
state_code: ME
|
|
118
|
+
output:
|
|
119
|
+
me_dependent_exemption_credit: 300
|
|
120
|
+
|
|
121
|
+
- name: Head of Household filer with one young dependent, earning $140,000, gets no exemption.
|
|
122
|
+
period: 2025
|
|
123
|
+
input:
|
|
124
|
+
people:
|
|
125
|
+
person1:
|
|
126
|
+
age: 42
|
|
127
|
+
person2:
|
|
128
|
+
age: 4
|
|
129
|
+
ctc_qualifying_child: true
|
|
130
|
+
tax_units:
|
|
131
|
+
tax_unit:
|
|
132
|
+
members: [person1, person2]
|
|
133
|
+
filing_status: HEAD_OF_HOUSEHOLD
|
|
134
|
+
me_agi: 140_000
|
|
135
|
+
households:
|
|
136
|
+
household:
|
|
137
|
+
state_code: ME
|
|
138
|
+
output:
|
|
139
|
+
me_dependent_exemption_credit: 0
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
- name: Child dependent under 6
|
|
2
|
+
period: 2025
|
|
3
|
+
input:
|
|
4
|
+
state_code: ME
|
|
5
|
+
ctc_qualifying_child: true
|
|
6
|
+
is_tax_unit_dependent: true
|
|
7
|
+
age: 2
|
|
8
|
+
output:
|
|
9
|
+
me_dependent_exemption_credit_amount_person: 600
|
|
10
|
+
|
|
11
|
+
- name: Child dependent over 6
|
|
12
|
+
period: 2025
|
|
13
|
+
input:
|
|
14
|
+
state_code: ME
|
|
15
|
+
ctc_qualifying_child: true
|
|
16
|
+
is_tax_unit_dependent: true
|
|
17
|
+
age: 8
|
|
18
|
+
output:
|
|
19
|
+
me_dependent_exemption_credit_amount_person: 300
|
|
20
|
+
|
|
21
|
+
- name: Non CTC eligible child
|
|
22
|
+
period: 2025
|
|
23
|
+
input:
|
|
24
|
+
state_code: ME
|
|
25
|
+
ctc_qualifying_child: false
|
|
26
|
+
is_tax_unit_dependent: true
|
|
27
|
+
age: 2
|
|
28
|
+
output:
|
|
29
|
+
me_dependent_exemption_credit_amount_person: 0
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Test script demonstrating UCGID hierarchical functionality.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
import numpy as np
|
|
5
6
|
from policyengine_us import Microsimulation
|
|
6
7
|
from policyengine_us.variables.household.demographic.geographic.ucgid.ucgid_enum import (
|
|
7
8
|
UCGID,
|
|
@@ -18,19 +19,16 @@ class TestUCGIDHierarchical:
|
|
|
18
19
|
# Test Congressional District (CA_23)
|
|
19
20
|
ca_23 = UCGID.CA_23
|
|
20
21
|
ca_23_codes = ca_23.get_hierarchical_codes()
|
|
21
|
-
print(f"CA_23 hierarchical codes: {ca_23_codes}")
|
|
22
22
|
assert ca_23_codes == ["5001800US0623", "0400000US06", "0100000US"]
|
|
23
23
|
|
|
24
24
|
# Test State (CA)
|
|
25
25
|
ca = UCGID.CA
|
|
26
26
|
ca_codes = ca.get_hierarchical_codes()
|
|
27
|
-
print(f"CA hierarchical codes: {ca_codes}")
|
|
28
27
|
assert ca_codes == ["0400000US06", "0100000US"]
|
|
29
28
|
|
|
30
29
|
# Test US
|
|
31
30
|
us = UCGID.US
|
|
32
31
|
us_codes = us.get_hierarchical_codes()
|
|
33
|
-
print(f"US hierarchical codes: {us_codes}")
|
|
34
32
|
assert us_codes == ["0100000US"]
|
|
35
33
|
|
|
36
34
|
# Test hierarchy matching
|
|
@@ -50,9 +48,74 @@ class TestUCGIDHierarchical:
|
|
|
50
48
|
# Convert the string back to enum to access hierarchical methods
|
|
51
49
|
ucgid_enum = UCGID[ucgid_string]
|
|
52
50
|
hierarchical_codes = ucgid_enum.get_hierarchical_codes()
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
|
|
52
|
+
# Should have 2 hierarchical codes for state-level UCGIDs: [state, US]
|
|
53
|
+
assert len(hierarchical_codes) == 2
|
|
54
|
+
assert (
|
|
55
|
+
hierarchical_codes[1] == "0100000US"
|
|
56
|
+
) # Second code should always be US
|
|
57
|
+
assert hierarchical_codes[0].startswith(
|
|
58
|
+
"0400000US"
|
|
59
|
+
) # First should be state-level
|
|
55
60
|
|
|
56
61
|
# Test hierarchy matching in simulation context
|
|
57
62
|
is_in_us = ucgid_enum.matches_hierarchy("0100000US")
|
|
58
63
|
assert is_in_us == True
|
|
64
|
+
|
|
65
|
+
def test_ucgid_str_variable(self):
|
|
66
|
+
"""Test the UCGID string variable functionality."""
|
|
67
|
+
simulation = Microsimulation()
|
|
68
|
+
ucgid_str_values = simulation.calculate("ucgid_str", "2024")
|
|
69
|
+
|
|
70
|
+
# The UCGID string variable should return a string representation
|
|
71
|
+
ucgid_str = ucgid_str_values.iloc[0]
|
|
72
|
+
assert type(ucgid_str) == str
|
|
73
|
+
assert (
|
|
74
|
+
ucgid_str.startswith("0100000US")
|
|
75
|
+
| ucgid_str.startswith("0400000US")
|
|
76
|
+
| ucgid_str.startswith("5001800US")
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Create a basic simulation to test with specific input values
|
|
80
|
+
from policyengine_us import Simulation
|
|
81
|
+
|
|
82
|
+
simulation = Simulation(
|
|
83
|
+
situation={
|
|
84
|
+
"people": {"person": {}},
|
|
85
|
+
"households": {"household": {"members": ["person"]}},
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
# Set a specific UCGID value for testing (CA_23)
|
|
90
|
+
simulation.set_input("ucgid", 2024, UCGID.CA_23)
|
|
91
|
+
|
|
92
|
+
# Calculate the ucgid_str value
|
|
93
|
+
ucgid_str_values = simulation.calculate("ucgid_str", 2024)
|
|
94
|
+
ucgid_str = ucgid_str_values[0]
|
|
95
|
+
|
|
96
|
+
# Verify it contains all three hierarchical codes
|
|
97
|
+
assert ucgid_str == "5001800US0623,0400000US06,0100000US"
|
|
98
|
+
|
|
99
|
+
def test_ucgid_microsimulation_input_override(self):
|
|
100
|
+
"""Test setting UCGID input for all households in a microsimulation."""
|
|
101
|
+
microsim = Microsimulation()
|
|
102
|
+
|
|
103
|
+
# Get initial values
|
|
104
|
+
ucgid_before = microsim.calculate("ucgid", 2024)
|
|
105
|
+
num_households = len(ucgid_before)
|
|
106
|
+
|
|
107
|
+
# Set all households to CA_23
|
|
108
|
+
input_array = np.array([UCGID.CA_23] * num_households)
|
|
109
|
+
microsim.set_input("ucgid", 2024, input_array)
|
|
110
|
+
|
|
111
|
+
# Verify the input was set
|
|
112
|
+
ucgid_after = microsim.calculate("ucgid", 2024)
|
|
113
|
+
after_values = ucgid_after.values
|
|
114
|
+
assert all(val == "CA_23" for val in after_values)
|
|
115
|
+
assert len(set(after_values)) == 1
|
|
116
|
+
|
|
117
|
+
# Test that ucgid_str now returns hierarchical codes for all households
|
|
118
|
+
ucgid_str_values = microsim.calculate("ucgid_str", 2024)
|
|
119
|
+
expected_str = "5001800US0623,0400000US06,0100000US"
|
|
120
|
+
str_values = ucgid_str_values.values
|
|
121
|
+
assert all(str_val == expected_str for str_val in str_values)
|
|
@@ -12,8 +12,6 @@ class me_dependent_exemption_credit(Variable):
|
|
|
12
12
|
defined_for = StateCode.ME
|
|
13
13
|
|
|
14
14
|
def formula(tax_unit, period, parameters):
|
|
15
|
-
# First get total the number of dependents (line 1).
|
|
16
|
-
dependents = tax_unit("tax_unit_dependents", period)
|
|
17
15
|
|
|
18
16
|
# Get their Maine AGI (line 3).
|
|
19
17
|
me_agi = tax_unit("me_agi", period)
|
|
@@ -24,7 +22,9 @@ class me_dependent_exemption_credit(Variable):
|
|
|
24
22
|
).gov.states.me.tax.income.credits.dependent_exemption
|
|
25
23
|
|
|
26
24
|
# Calculate the maximum dependents exemption amount (line 2).
|
|
27
|
-
max_amount =
|
|
25
|
+
max_amount = add(
|
|
26
|
+
tax_unit, period, ["me_dependent_exemption_credit_amount_person"]
|
|
27
|
+
)
|
|
28
28
|
|
|
29
29
|
# Get filing status.
|
|
30
30
|
filing_status = tax_unit("filing_status", period)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from policyengine_us.model_api import *
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class me_dependent_exemption_credit_amount_person(Variable):
|
|
5
|
+
value_type = float
|
|
6
|
+
entity = Person
|
|
7
|
+
unit = USD
|
|
8
|
+
label = "Maine dependent exemption credit amount for each person"
|
|
9
|
+
reference = "https://www.mainelegislature.org/legis/statutes/36/title36sec5219-SS.html"
|
|
10
|
+
definition_period = YEAR
|
|
11
|
+
defined_for = "ctc_qualifying_child"
|
|
12
|
+
|
|
13
|
+
def formula(person, period, parameters):
|
|
14
|
+
dependent = person("is_tax_unit_dependent", period)
|
|
15
|
+
p = parameters(
|
|
16
|
+
period
|
|
17
|
+
).gov.states.me.tax.income.credits.dependent_exemption
|
|
18
|
+
age = person("age", period)
|
|
19
|
+
multiplier = p.multiplier.calc(age)
|
|
20
|
+
return dependent * multiplier * p.amount
|
|
@@ -20,78 +20,75 @@ class ucgid(Variable):
|
|
|
20
20
|
def formula(household, period, parameters):
|
|
21
21
|
simulation: Simulation = household.simulation
|
|
22
22
|
|
|
23
|
-
#
|
|
24
|
-
|
|
23
|
+
# Check if this variable has been set as input
|
|
24
|
+
if simulation.get_holder("ucgid").get_known_periods():
|
|
25
|
+
return household("ucgid", period)
|
|
25
26
|
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
# Try to derive from state_code
|
|
28
|
+
state_code_enum = household("state_code", period)
|
|
29
|
+
state_code_strings = state_code_enum.decode_to_str()
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
31
|
+
# Map state codes to UCGID state values
|
|
32
|
+
state_mapping = {
|
|
33
|
+
"AL": UCGID.AL,
|
|
34
|
+
"AK": UCGID.AK,
|
|
35
|
+
"AZ": UCGID.AZ,
|
|
36
|
+
"AR": UCGID.AR,
|
|
37
|
+
"CA": UCGID.CA,
|
|
38
|
+
"CO": UCGID.CO,
|
|
39
|
+
"CT": UCGID.CT,
|
|
40
|
+
"DE": UCGID.DE,
|
|
41
|
+
"DC": UCGID.DC,
|
|
42
|
+
"FL": UCGID.FL,
|
|
43
|
+
"GA": UCGID.GA,
|
|
44
|
+
"HI": UCGID.HI,
|
|
45
|
+
"ID": UCGID.ID,
|
|
46
|
+
"IL": UCGID.IL,
|
|
47
|
+
"IN": UCGID.IN,
|
|
48
|
+
"IA": UCGID.IA,
|
|
49
|
+
"KS": UCGID.KS,
|
|
50
|
+
"KY": UCGID.KY,
|
|
51
|
+
"LA": UCGID.LA,
|
|
52
|
+
"ME": UCGID.ME,
|
|
53
|
+
"MD": UCGID.MD,
|
|
54
|
+
"MA": UCGID.MA,
|
|
55
|
+
"MI": UCGID.MI,
|
|
56
|
+
"MN": UCGID.MN,
|
|
57
|
+
"MS": UCGID.MS,
|
|
58
|
+
"MO": UCGID.MO,
|
|
59
|
+
"MT": UCGID.MT,
|
|
60
|
+
"NE": UCGID.NE,
|
|
61
|
+
"NV": UCGID.NV,
|
|
62
|
+
"NH": UCGID.NH,
|
|
63
|
+
"NJ": UCGID.NJ,
|
|
64
|
+
"NM": UCGID.NM,
|
|
65
|
+
"NY": UCGID.NY,
|
|
66
|
+
"NC": UCGID.NC,
|
|
67
|
+
"ND": UCGID.ND,
|
|
68
|
+
"OH": UCGID.OH,
|
|
69
|
+
"OK": UCGID.OK,
|
|
70
|
+
"OR": UCGID.OR,
|
|
71
|
+
"PA": UCGID.PA,
|
|
72
|
+
"RI": UCGID.RI,
|
|
73
|
+
"SC": UCGID.SC,
|
|
74
|
+
"SD": UCGID.SD,
|
|
75
|
+
"TN": UCGID.TN,
|
|
76
|
+
"TX": UCGID.TX,
|
|
77
|
+
"UT": UCGID.UT,
|
|
78
|
+
"VT": UCGID.VT,
|
|
79
|
+
"VA": UCGID.VA,
|
|
80
|
+
"WA": UCGID.WA,
|
|
81
|
+
"WV": UCGID.WV,
|
|
82
|
+
"WI": UCGID.WI,
|
|
83
|
+
"WY": UCGID.WY,
|
|
84
|
+
}
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
result[i] = UCGID.US
|
|
86
|
+
# Convert state code strings to UCGID values
|
|
87
|
+
result = np.empty(len(state_code_strings), dtype=object)
|
|
88
|
+
for i, state_str in enumerate(state_code_strings):
|
|
89
|
+
if state_str in state_mapping:
|
|
90
|
+
result[i] = state_mapping[state_str]
|
|
91
|
+
else:
|
|
92
|
+
result[i] = UCGID.US
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# Default fallback
|
|
97
|
-
return np.full(household.count, UCGID.US, dtype=object)
|
|
94
|
+
return result
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
from policyengine_us.model_api import *
|
|
2
|
+
from policyengine_us.variables.household.demographic.geographic.ucgid.ucgid_enum import (
|
|
3
|
+
UCGID,
|
|
4
|
+
)
|
|
2
5
|
|
|
3
6
|
|
|
4
7
|
class ucgid_str(Variable):
|
|
@@ -9,4 +12,18 @@ class ucgid_str(Variable):
|
|
|
9
12
|
definition_period = YEAR
|
|
10
13
|
|
|
11
14
|
def formula(household, period, parameters):
|
|
12
|
-
|
|
15
|
+
import numpy as np
|
|
16
|
+
|
|
17
|
+
ucgid_enum_names = household("ucgid", period).decode_to_str()
|
|
18
|
+
|
|
19
|
+
# Convert each enum name to its hierarchical codes
|
|
20
|
+
result = []
|
|
21
|
+
for enum_name in ucgid_enum_names:
|
|
22
|
+
# Get the enum instance from its name
|
|
23
|
+
ucgid_enum = UCGID[enum_name]
|
|
24
|
+
|
|
25
|
+
# Get all hierarchical codes and join with commas
|
|
26
|
+
hierarchical_codes = ucgid_enum.get_hierarchical_codes()
|
|
27
|
+
result.append(",".join(hierarchical_codes))
|
|
28
|
+
|
|
29
|
+
return np.array(result)
|
|
@@ -1919,9 +1919,10 @@ policyengine_us/parameters/gov/states/me/tax/income/credits/child_care/README.md
|
|
|
1919
1919
|
policyengine_us/parameters/gov/states/me/tax/income/credits/child_care/max_amount.yaml,sha256=21mMxfXofBphhD5_o-jSzCi1REasq0m0dE7OEuFqGcc,1002
|
|
1920
1920
|
policyengine_us/parameters/gov/states/me/tax/income/credits/child_care/share_of_federal_credit/non_step_4.yaml,sha256=L1B_COmQbVF57YX8IAOWvt9NroQCLet-9pG6kE5u-BI,1099
|
|
1921
1921
|
policyengine_us/parameters/gov/states/me/tax/income/credits/child_care/share_of_federal_credit/step_4.yaml,sha256=nEP3iK6vF7ZA8a3WiydC0nKyf_UCchZwDuVd08BJeIU,1797
|
|
1922
|
-
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/amount.yaml,sha256=
|
|
1922
|
+
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/amount.yaml,sha256=nxaRzgDdZonSu4245tC1NETNLhStRuyR6eK-jKliPjo,1908
|
|
1923
|
+
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/multiplier.yaml,sha256=_1zsLtWBY1l0wxZoYY7NCoSBuWlgVonwnlrbXYRZj0I,644
|
|
1923
1924
|
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/phase_out/increment.yaml,sha256=pujbvbSt4ozZYA5B1AOhObCob7rWhsluCmFbeh80gkE,1821
|
|
1924
|
-
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/phase_out/start.yaml,sha256=
|
|
1925
|
+
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/phase_out/start.yaml,sha256=HmgTu50z_WM_xALFTs_07oqiDFScTgvQEGzluR4bFpQ,2133
|
|
1925
1926
|
policyengine_us/parameters/gov/states/me/tax/income/credits/dependent_exemption/phase_out/step.yaml,sha256=Yu9dCRQIgYytrrlmPY60LGb7VIarOcu_bVktyroGE3I,1861
|
|
1926
1927
|
policyengine_us/parameters/gov/states/me/tax/income/credits/eitc/README.md,sha256=8WsaWutBw5kaloVJ0HEU-S3TCKXVKh0YjeJcrhWYL6I,27
|
|
1927
1928
|
policyengine_us/parameters/gov/states/me/tax/income/credits/eitc/rate/no_qualifying_child.yaml,sha256=eOiXygs2Q30PvDofZs7Kb0XB1kDHCiQNIQMpNEW2vcw,931
|
|
@@ -4270,7 +4271,8 @@ policyengine_us/tests/policy/baseline/gov/states/me/tax/income/me_income_tax_bef
|
|
|
4270
4271
|
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/me_income_tax_before_refundable_credits.yaml,sha256=0tvQcTBaiwc44a0xABs-dVkPCfoRLqAQVJqiRfTnYd4,735
|
|
4271
4272
|
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/me_withheld_income_tax.yaml,sha256=ulJvi6kTaT0nEGxvl_rHaMxLU24bev5WMobcAanDVKY,716
|
|
4272
4273
|
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/child_care_credit.yaml,sha256=Cj7j-r2Fhf4ll1dwv0dIDeiR3cUGPY0w77yVTCiOxkg,1759
|
|
4273
|
-
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/me_dependent_exemption_credit.yaml,sha256=
|
|
4274
|
+
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/me_dependent_exemption_credit.yaml,sha256=MAww1t3yyz_k2JeR53_4y8B2vYFWpeCkeN4dzC41jVI,3468
|
|
4275
|
+
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/me_dependent_exemption_credit_amount_person.yaml,sha256=XVvckAMGxVh5bWBJ8ESnx2xEDwRMiJzNhMUkO2F9sYU,635
|
|
4274
4276
|
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/me_eitc.yaml,sha256=oVnDOWRaYwEcqURF_9dTaLjygUF9bu2W-teC45iHOLk,2069
|
|
4275
4277
|
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/property_tax_fairness_credit/me_property_tax_fairness_credit.yaml,sha256=aYTrFxg-nTGdnmboA7hSZBa4xOzOFVoWlhCgudEkC9A,967
|
|
4276
4278
|
policyengine_us/tests/policy/baseline/gov/states/me/tax/income/credits/property_tax_fairness_credit/me_property_tax_fairness_credit_base_cap.yaml,sha256=VCPXVoCo2g8S3dy3bOFUMJVbSRTdM_-LFD0szdw7lc0,1577
|
|
@@ -5136,7 +5138,7 @@ policyengine_us/tests/policy/contrib/ubi_center/flat_tax.yaml,sha256=O6krfJ2rovW
|
|
|
5136
5138
|
policyengine_us/tests/policy/reform/ctc_expansion.yaml,sha256=soq-LqWwbb7fNQJFphx_1gSc8uDGOhtr-5P93oY2Mpg,1596
|
|
5137
5139
|
policyengine_us/tests/policy/reform/winship.yaml,sha256=OPfsoZ0NrlPU25hJadZXycrYLaM0wPUGXjBrn6_8gR4,1706
|
|
5138
5140
|
policyengine_us/tests/utilities/test_load_county_fips_dataset.py,sha256=QAURDL6IMN5gafUOcTri1PUet6khLNZ_Bov6NdW_pMM,4397
|
|
5139
|
-
policyengine_us/tests/utilities/test_ucgid_hierarchical.py,sha256=
|
|
5141
|
+
policyengine_us/tests/utilities/test_ucgid_hierarchical.py,sha256=WZYqWHw6-QQAv0Wd3bGgAcgPgZ0ILhOxpC-kgo4HRkU,4532
|
|
5140
5142
|
policyengine_us/tests/variables/gov/states/vt/tax/income/vt_eitc.yaml,sha256=gE-ZtclGqoFKs87k9VUgKEoVO2iZkFBq4k-ixGtde14,2341
|
|
5141
5143
|
policyengine_us/tests/variables/gov/states/vt/tax/income/adjusted_gross_income/subtractions/retirement_income_exemption/vt_military_retirement_income_based_exemption.yaml,sha256=b5I5ekAoDCrojCLwEZMoBEDdUX9zDw1bM-4iQLmyTng,3267
|
|
5142
5144
|
policyengine_us/tests/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml,sha256=51NtThz2bNwVD7o-2VXZqplDjKUAYzIiIzyL1PfXK94,3244
|
|
@@ -6797,7 +6799,8 @@ policyengine_us/variables/gov/states/me/tax/income/credits/child_care_credit/me_
|
|
|
6797
6799
|
policyengine_us/variables/gov/states/me/tax/income/credits/child_care_credit/me_non_refundable_child_care_credit.py,sha256=i-jIlQHb1Xw16J35KSoRgtdG9gFR6WyhAO99UC19rIc,898
|
|
6798
6800
|
policyengine_us/variables/gov/states/me/tax/income/credits/child_care_credit/me_refundable_child_care_credit.py,sha256=4es6QFY3nlgZfWo2SWsrE3slR9WA9phtXrpjCqtwlXA,752
|
|
6799
6801
|
policyengine_us/variables/gov/states/me/tax/income/credits/child_care_credit/me_step_4_share_of_child_care_expenses.py,sha256=qCu7VX7_onqqYTun8LIY4nr6TyEC_4fmlhi7l_Ir3fk,599
|
|
6800
|
-
policyengine_us/variables/gov/states/me/tax/income/credits/dependent_exemption/me_dependent_exemption_credit.py,sha256=
|
|
6802
|
+
policyengine_us/variables/gov/states/me/tax/income/credits/dependent_exemption/me_dependent_exemption_credit.py,sha256=1PmEg6YOT_s7eqpDeqALWZh_bduzJBzT8koyNP3s50E,1552
|
|
6803
|
+
policyengine_us/variables/gov/states/me/tax/income/credits/dependent_exemption/me_dependent_exemption_credit_amount_person.py,sha256=DdBdqYjTImPUKmx1VBQLYYpGc_n-6AnDjgsMovr6-mM,734
|
|
6801
6804
|
policyengine_us/variables/gov/states/me/tax/income/credits/fairness/me_sales_and_property_tax_fairness_credit_income.py,sha256=hhlrzOqwt4KaWOLpNuPrnfpQK6CdfkSPMeu7UiF_bxY,462
|
|
6802
6805
|
policyengine_us/variables/gov/states/me/tax/income/credits/fairness/property_tax_fairness_credit/me_property_tax_fairness_credit.py,sha256=RFZEfM_ZW0Z0aRUBaZuCGt15jJ4V-x0ekForEI7dIQo,936
|
|
6803
6806
|
policyengine_us/variables/gov/states/me/tax/income/credits/fairness/property_tax_fairness_credit/me_property_tax_fairness_credit_base_cap.py,sha256=vr2eHxFq3sLvtr1TzGfBS9X-cOpfJHFsNKc8XUhII34,1478
|
|
@@ -7785,9 +7788,9 @@ policyengine_us/variables/household/demographic/geographic/county/county_str.py,
|
|
|
7785
7788
|
policyengine_us/variables/household/demographic/geographic/county/first_county_in_state.py,sha256=yXCj-LVjxPeILIg42ijefTmi_j4NxJwX0kMtoE47xic,1578
|
|
7786
7789
|
policyengine_us/variables/household/demographic/geographic/state/average_home_energy_use_in_state.py,sha256=aaGYAXLU7tsx-A9NW4nyLij5J5mp0WTRXsyObngekvY,319
|
|
7787
7790
|
policyengine_us/variables/household/demographic/geographic/state/in_state.py,sha256=o3ksZCOHtlJ1JGHIXAPlqcs5-rVbTgOCcDdN1-fYqmA,551
|
|
7788
|
-
policyengine_us/variables/household/demographic/geographic/ucgid/ucgid.py,sha256=
|
|
7791
|
+
policyengine_us/variables/household/demographic/geographic/ucgid/ucgid.py,sha256=SwONHVRvHmUFHvPZQMYY7Y9e7gz74kisLjJICpHdyKg,2874
|
|
7789
7792
|
policyengine_us/variables/household/demographic/geographic/ucgid/ucgid_enum.py,sha256=dkeusTBI1j4xAGmRFkfSsyT3Hq5gHZwRUkSeISeNbx0,15636
|
|
7790
|
-
policyengine_us/variables/household/demographic/geographic/ucgid/ucgid_str.py,sha256=
|
|
7793
|
+
policyengine_us/variables/household/demographic/geographic/ucgid/ucgid_str.py,sha256=GnIRg2tc0376YazPX7wm7YQgMQaYPm2Au47vc1E5JcM,914
|
|
7791
7794
|
policyengine_us/variables/household/demographic/geographic/zip_code/three_digit_zip_code.py,sha256=7q0FQRahTOINiK2vlAyHEa5xIKowM5Kgl60-kR3ZuWU,426
|
|
7792
7795
|
policyengine_us/variables/household/demographic/geographic/zip_code/zip_code.py,sha256=PZiLb84BgKQ_Suvd6iUiEnzySu3Vtiv8FOlfB4rnagQ,1691
|
|
7793
7796
|
policyengine_us/variables/household/demographic/household/bedrooms.py,sha256=4ltdIRLdmeuTKAskn4pdgxZuxEE-4rz0ffPnIKobc-o,164
|
|
@@ -8236,8 +8239,8 @@ policyengine_us/variables/input/farm_income.py,sha256=BEKxYmHNNnWJAAvULl5qZJigy5
|
|
|
8236
8239
|
policyengine_us/variables/input/geography.py,sha256=XmBlgXhzBoLRKk6R8taVZHqUw1eU8MbNeGS9iJ7_l44,4506
|
|
8237
8240
|
policyengine_us/variables/input/self_employment_income.py,sha256=PwsGz8R4lRikKWUYOhsC0qosNNLXq4f5SQmfw4S3mk8,511
|
|
8238
8241
|
policyengine_us/variables/input/self_employment_income_before_lsr.py,sha256=E8fcX9Nlyqz8dziHhQv_euutdmoIwFMMWePUwbbwv_w,379
|
|
8239
|
-
policyengine_us-1.365.
|
|
8240
|
-
policyengine_us-1.365.
|
|
8241
|
-
policyengine_us-1.365.
|
|
8242
|
-
policyengine_us-1.365.
|
|
8243
|
-
policyengine_us-1.365.
|
|
8242
|
+
policyengine_us-1.365.2.dist-info/METADATA,sha256=qLyyEHeqzYRtGqiiroPiDXwW66voQe_YeNOfXJWLD0Y,1693
|
|
8243
|
+
policyengine_us-1.365.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8244
|
+
policyengine_us-1.365.2.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
|
|
8245
|
+
policyengine_us-1.365.2.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
|
|
8246
|
+
policyengine_us-1.365.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|