policyengine-us 1.370.1__py3-none-any.whl → 1.371.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of policyengine-us might be problematic. Click here for more details.
- policyengine_us/data/__init__.py +1 -0
- policyengine_us/data/zip_code_dataset.py +11 -0
- policyengine_us/system.py +4 -5
- policyengine_us/tests/policy/baseline/gov/ssa/ssi/integration.yaml +1 -1
- policyengine_us/tests/policy/baseline/gov/ssa/ssi/is_ssi_eligible.yaml +3 -3
- policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_amount_if_eligible.yaml +146 -0
- policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_claim_is_joint.yaml +116 -5
- policyengine_us/tests/policy/baseline/gov/ssa/ssi/uncapped_ssi.yaml +4 -18
- policyengine_us/tools/taxsim/generate_taxsim_tests.py +4 -2
- policyengine_us/variables/gov/ssa/ssi/is_ssi_eligible.py +9 -2
- policyengine_us/variables/gov/ssa/ssi/ssi_amount_if_eligible.py +13 -8
- policyengine_us/variables/gov/ssa/ssi/ssi_claim_is_joint.py +5 -12
- policyengine_us/variables/household/demographic/geographic/county/county.py +1 -1
- policyengine_us/variables/household/demographic/geographic/zip_code/zip_code.py +1 -1
- {policyengine_us-1.370.1.dist-info → policyengine_us-1.371.0.dist-info}/METADATA +1 -2
- {policyengine_us-1.370.1.dist-info → policyengine_us-1.371.0.dist-info}/RECORD +19 -16
- {policyengine_us-1.370.1.dist-info → policyengine_us-1.371.0.dist-info}/WHEEL +0 -0
- {policyengine_us-1.370.1.dist-info → policyengine_us-1.371.0.dist-info}/entry_points.txt +0 -0
- {policyengine_us-1.370.1.dist-info → policyengine_us-1.371.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .zip_code_dataset import ZIP_CODE_DATASET
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
import pandas as pd
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
ZIP_CODE_DATASET_PATH = Path(__file__).parent / "zip_codes.csv.gz"
|
|
6
|
+
|
|
7
|
+
# Avoid circular import error when -us-data is initialized
|
|
8
|
+
if os.path.exists(ZIP_CODE_DATASET_PATH):
|
|
9
|
+
ZIP_CODE_DATASET = pd.read_csv(ZIP_CODE_DATASET_PATH, compression="gzip")
|
|
10
|
+
else:
|
|
11
|
+
ZIP_CODE_DATASET = None
|
policyengine_us/system.py
CHANGED
|
@@ -27,7 +27,6 @@ from policyengine_core.parameters.operations.uprate_parameters import (
|
|
|
27
27
|
uprate_parameters,
|
|
28
28
|
)
|
|
29
29
|
from .tools.default_uprating import add_default_uprating
|
|
30
|
-
from policyengine_us_data import DATASETS, CPS_2024
|
|
31
30
|
|
|
32
31
|
from typing import Annotated
|
|
33
32
|
|
|
@@ -37,6 +36,8 @@ COUNTRY_DIR = Path(__file__).parent
|
|
|
37
36
|
CURRENT_YEAR = 2024
|
|
38
37
|
DEFAULT_START_DATE = str(CURRENT_YEAR) + "-01-01"
|
|
39
38
|
|
|
39
|
+
DEFAULT_DATASET = "hf://policyengine/policyengine-us-data/enhanced_cps_2024.h5"
|
|
40
|
+
|
|
40
41
|
|
|
41
42
|
class CountryTaxBenefitSystem(TaxBenefitSystem):
|
|
42
43
|
"""
|
|
@@ -131,7 +132,6 @@ class Simulation(CoreSimulation):
|
|
|
131
132
|
default_role = "member"
|
|
132
133
|
default_calculation_period = CURRENT_YEAR
|
|
133
134
|
default_input_period = CURRENT_YEAR
|
|
134
|
-
datasets = DATASETS
|
|
135
135
|
|
|
136
136
|
def __init__(self, *args, **kwargs):
|
|
137
137
|
start_instant: Annotated[str, "ISO date format YYYY-MM-DD"] = (
|
|
@@ -198,12 +198,11 @@ class Microsimulation(CoreMicrosimulation):
|
|
|
198
198
|
|
|
199
199
|
default_tax_benefit_system = CountryTaxBenefitSystem
|
|
200
200
|
default_tax_benefit_system_instance = system
|
|
201
|
-
default_dataset =
|
|
201
|
+
default_dataset = DEFAULT_DATASET
|
|
202
202
|
default_dataset_year = CURRENT_YEAR
|
|
203
203
|
default_role = "member"
|
|
204
204
|
default_calculation_period = CURRENT_YEAR
|
|
205
205
|
default_input_period = CURRENT_YEAR
|
|
206
|
-
datasets = DATASETS
|
|
207
206
|
|
|
208
207
|
def __init__(self, *args, **kwargs):
|
|
209
208
|
start_instant: Annotated[str, "ISO date format YYYY-MM-DD"] = (
|
|
@@ -281,7 +280,7 @@ class Microsimulation(CoreMicrosimulation):
|
|
|
281
280
|
class IndividualSim(CoreIndividualSim): # Deprecated
|
|
282
281
|
tax_benefit_system = CountryTaxBenefitSystem
|
|
283
282
|
entities = {entity.key: entity for entity in entities}
|
|
284
|
-
default_dataset =
|
|
283
|
+
default_dataset = DEFAULT_DATASET
|
|
285
284
|
default_roles = dict(
|
|
286
285
|
tax_unit="member",
|
|
287
286
|
spm_unit="member",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
period: 2022
|
|
3
3
|
input:
|
|
4
4
|
meets_ssi_resource_test: true
|
|
5
|
-
|
|
5
|
+
is_ssi_aged_blind_disabled: true
|
|
6
6
|
output:
|
|
7
7
|
is_ssi_eligible: true
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
period: 2022
|
|
11
11
|
input:
|
|
12
12
|
meets_ssi_resource_test: false
|
|
13
|
-
|
|
13
|
+
is_ssi_aged_blind_disabled: true
|
|
14
14
|
output:
|
|
15
15
|
is_ssi_eligible: false
|
|
16
16
|
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
period: 2022
|
|
19
19
|
input:
|
|
20
20
|
meets_ssi_resource_test: true
|
|
21
|
-
|
|
21
|
+
is_ssi_aged_blind_disabled: false
|
|
22
22
|
output:
|
|
23
23
|
is_ssi_eligible: false
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
- name: Case A, single disabled parent with non eligible dependent child.
|
|
2
|
+
period: 2025-01
|
|
3
|
+
input:
|
|
4
|
+
people:
|
|
5
|
+
person1:
|
|
6
|
+
age: 30
|
|
7
|
+
is_disabled: true
|
|
8
|
+
person2:
|
|
9
|
+
age: 4
|
|
10
|
+
is_tax_unit_dependent: true
|
|
11
|
+
spm_units:
|
|
12
|
+
spm_unit:
|
|
13
|
+
members: [person1, person2]
|
|
14
|
+
households:
|
|
15
|
+
household:
|
|
16
|
+
members: [person1, person2]
|
|
17
|
+
output:
|
|
18
|
+
ssi_amount_if_eligible: [967, 0]
|
|
19
|
+
|
|
20
|
+
- name: Case A1, single disabled parent with a disabled child.
|
|
21
|
+
period: 2025-01
|
|
22
|
+
input:
|
|
23
|
+
people:
|
|
24
|
+
person1:
|
|
25
|
+
age: 30
|
|
26
|
+
is_disabled: true
|
|
27
|
+
is_tax_unit_head: true
|
|
28
|
+
person2:
|
|
29
|
+
age: 4
|
|
30
|
+
is_tax_unit_dependent: true
|
|
31
|
+
is_disabled: true
|
|
32
|
+
spm_units:
|
|
33
|
+
spm_unit:
|
|
34
|
+
members: [person1, person2]
|
|
35
|
+
households:
|
|
36
|
+
household:
|
|
37
|
+
members: [person1, person2]
|
|
38
|
+
output:
|
|
39
|
+
ssi_amount_if_eligible: [967, 967]
|
|
40
|
+
|
|
41
|
+
- name: Case A2, single healthy parent with a disabled child.
|
|
42
|
+
period: 2025-01
|
|
43
|
+
input:
|
|
44
|
+
people:
|
|
45
|
+
person1:
|
|
46
|
+
age: 30
|
|
47
|
+
is_tax_unit_head: true
|
|
48
|
+
person2:
|
|
49
|
+
age: 4
|
|
50
|
+
is_tax_unit_dependent: true
|
|
51
|
+
is_disabled: true
|
|
52
|
+
spm_units:
|
|
53
|
+
spm_unit:
|
|
54
|
+
members: [person1, person2]
|
|
55
|
+
households:
|
|
56
|
+
household:
|
|
57
|
+
members: [person1, person2]
|
|
58
|
+
output:
|
|
59
|
+
ssi_amount_if_eligible: [0, 967]
|
|
60
|
+
|
|
61
|
+
- name: Case B, joint filers, one of them is disabled.
|
|
62
|
+
period: 2025-01
|
|
63
|
+
input:
|
|
64
|
+
people:
|
|
65
|
+
person1:
|
|
66
|
+
age: 30
|
|
67
|
+
is_disabled: true
|
|
68
|
+
person2:
|
|
69
|
+
age: 22
|
|
70
|
+
spm_units:
|
|
71
|
+
spm_unit:
|
|
72
|
+
members: [person1, person2]
|
|
73
|
+
households:
|
|
74
|
+
household:
|
|
75
|
+
members: [person1, person2]
|
|
76
|
+
output:
|
|
77
|
+
ssi_amount_if_eligible: [967, 0]
|
|
78
|
+
|
|
79
|
+
- name: Case B1, joint filers, both of them are disabled.
|
|
80
|
+
period: 2025-01
|
|
81
|
+
input:
|
|
82
|
+
people:
|
|
83
|
+
person1:
|
|
84
|
+
age: 30
|
|
85
|
+
is_disabled: true
|
|
86
|
+
is_tax_unit_head: true
|
|
87
|
+
person2:
|
|
88
|
+
age: 22
|
|
89
|
+
is_disabled: true
|
|
90
|
+
is_tax_unit_spouse: true
|
|
91
|
+
spm_units:
|
|
92
|
+
spm_unit:
|
|
93
|
+
members: [person1, person2]
|
|
94
|
+
households:
|
|
95
|
+
household:
|
|
96
|
+
members: [person1, person2]
|
|
97
|
+
output:
|
|
98
|
+
ssi_amount_if_eligible: [725, 725]
|
|
99
|
+
|
|
100
|
+
- name: Case C, two adults, one eligible and the other ineligible, and a eligible child.
|
|
101
|
+
period: 2025-01
|
|
102
|
+
input:
|
|
103
|
+
people:
|
|
104
|
+
person1:
|
|
105
|
+
age: 30
|
|
106
|
+
is_disabled: true
|
|
107
|
+
is_tax_unit_head: true
|
|
108
|
+
person2:
|
|
109
|
+
age: 22
|
|
110
|
+
person3:
|
|
111
|
+
age: 5
|
|
112
|
+
is_disabled: true
|
|
113
|
+
is_tax_unit_dependent: true
|
|
114
|
+
spm_units:
|
|
115
|
+
spm_unit:
|
|
116
|
+
members: [person1, person2, person3]
|
|
117
|
+
households:
|
|
118
|
+
household:
|
|
119
|
+
members: [person1, person2, person3]
|
|
120
|
+
output:
|
|
121
|
+
ssi_amount_if_eligible: [967, 0, 967]
|
|
122
|
+
|
|
123
|
+
- name: Case C1, joint filers, both head and spouse eligible, and a eligible child.
|
|
124
|
+
period: 2025-01
|
|
125
|
+
input:
|
|
126
|
+
people:
|
|
127
|
+
person1:
|
|
128
|
+
age: 30
|
|
129
|
+
is_disabled: true
|
|
130
|
+
is_tax_unit_head: true
|
|
131
|
+
person2:
|
|
132
|
+
age: 22
|
|
133
|
+
is_disabled: true
|
|
134
|
+
is_tax_unit_spouse: true
|
|
135
|
+
person3:
|
|
136
|
+
age: 5
|
|
137
|
+
is_disabled: true
|
|
138
|
+
is_tax_unit_dependent: true
|
|
139
|
+
spm_units:
|
|
140
|
+
spm_unit:
|
|
141
|
+
members: [person1, person2, person3]
|
|
142
|
+
households:
|
|
143
|
+
household:
|
|
144
|
+
members: [person1, person2, person3]
|
|
145
|
+
output:
|
|
146
|
+
ssi_amount_if_eligible: [725, 725, 967]
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
- name: SSI claim is joint
|
|
1
|
+
- name: Case 1, SSI claim is joint.
|
|
2
2
|
period: 2023
|
|
3
3
|
input:
|
|
4
4
|
people:
|
|
5
5
|
# Single person in a marital unit
|
|
6
6
|
person1:
|
|
7
|
-
|
|
7
|
+
is_disabled: true
|
|
8
8
|
is_tax_unit_head: true
|
|
9
9
|
# Two people in a marital unit, both SSI eligible
|
|
10
10
|
person2:
|
|
11
|
-
|
|
11
|
+
is_disabled: true
|
|
12
12
|
is_tax_unit_head: true
|
|
13
13
|
person3:
|
|
14
|
-
|
|
14
|
+
is_disabled: true
|
|
15
15
|
is_tax_unit_spouse: true
|
|
16
16
|
# Person not eligible for SSI
|
|
17
17
|
person4:
|
|
18
|
-
|
|
18
|
+
is_disabled: false
|
|
19
19
|
is_tax_unit_head: true
|
|
20
20
|
tax_units:
|
|
21
21
|
tax_unit1:
|
|
@@ -33,3 +33,114 @@
|
|
|
33
33
|
members: [person4]
|
|
34
34
|
output:
|
|
35
35
|
ssi_claim_is_joint: [false, true, true, false]
|
|
36
|
+
|
|
37
|
+
- name: Case 2, SSI claim is not joint.
|
|
38
|
+
period: 2023
|
|
39
|
+
input:
|
|
40
|
+
people:
|
|
41
|
+
# Single person in a marital unit
|
|
42
|
+
person1:
|
|
43
|
+
is_disabled: true
|
|
44
|
+
is_tax_unit_head: true
|
|
45
|
+
# Two people in a marital unit, only one SSI eligible
|
|
46
|
+
person2:
|
|
47
|
+
is_disabled: true
|
|
48
|
+
is_tax_unit_head: true
|
|
49
|
+
person3:
|
|
50
|
+
is_disabled: false
|
|
51
|
+
is_tax_unit_spouse: true
|
|
52
|
+
# Person not eligible for SSI
|
|
53
|
+
person4:
|
|
54
|
+
is_disabled: false
|
|
55
|
+
is_tax_unit_head: true
|
|
56
|
+
tax_units:
|
|
57
|
+
tax_unit1:
|
|
58
|
+
members: [person1]
|
|
59
|
+
tax_unit2:
|
|
60
|
+
members: [person2, person3]
|
|
61
|
+
tax_unit3:
|
|
62
|
+
members: [person4]
|
|
63
|
+
marital_units:
|
|
64
|
+
marital_unit1:
|
|
65
|
+
members: [person1]
|
|
66
|
+
marital_unit2:
|
|
67
|
+
members: [person2, person3]
|
|
68
|
+
marital_unit3:
|
|
69
|
+
members: [person4]
|
|
70
|
+
output:
|
|
71
|
+
ssi_claim_is_joint: [false, false, false, false]
|
|
72
|
+
|
|
73
|
+
- name: Case 3, eligible head with an eligible child, not joint.
|
|
74
|
+
period: 2023
|
|
75
|
+
input:
|
|
76
|
+
people:
|
|
77
|
+
person1:
|
|
78
|
+
is_disabled: true
|
|
79
|
+
is_tax_unit_head: true
|
|
80
|
+
person2:
|
|
81
|
+
age: 4
|
|
82
|
+
is_disabled: true
|
|
83
|
+
is_tax_unit_dependent: true
|
|
84
|
+
marital_units:
|
|
85
|
+
marital_unit:
|
|
86
|
+
members: [person1]
|
|
87
|
+
tax_units:
|
|
88
|
+
tax_unit:
|
|
89
|
+
members: [person1, person2]
|
|
90
|
+
output:
|
|
91
|
+
ssi_claim_is_joint: [false, false]
|
|
92
|
+
|
|
93
|
+
- name: Case 4, two adults, one eligible and the other is not, and a eligible child.
|
|
94
|
+
period: 2025-01
|
|
95
|
+
input:
|
|
96
|
+
people:
|
|
97
|
+
person1:
|
|
98
|
+
age: 30
|
|
99
|
+
is_disabled: true
|
|
100
|
+
is_tax_unit_head: true
|
|
101
|
+
person2:
|
|
102
|
+
age: 22
|
|
103
|
+
is_tax_unit_spouse: true
|
|
104
|
+
person3:
|
|
105
|
+
age: 5
|
|
106
|
+
is_disabled: true
|
|
107
|
+
is_tax_unit_dependent: true
|
|
108
|
+
marital_units:
|
|
109
|
+
marital_unit:
|
|
110
|
+
members: [person1, person2]
|
|
111
|
+
spm_units:
|
|
112
|
+
spm_unit:
|
|
113
|
+
members: [person1, person2, person3]
|
|
114
|
+
households:
|
|
115
|
+
household:
|
|
116
|
+
members: [person1, person2, person3]
|
|
117
|
+
output:
|
|
118
|
+
ssi_claim_is_joint: [false, false, false]
|
|
119
|
+
|
|
120
|
+
- name: Case 5, martial unit, both head and spouse eligible, and a eligible child.
|
|
121
|
+
period: 2025-01
|
|
122
|
+
input:
|
|
123
|
+
people:
|
|
124
|
+
person1:
|
|
125
|
+
age: 30
|
|
126
|
+
is_disabled: true
|
|
127
|
+
is_tax_unit_head: true
|
|
128
|
+
person2:
|
|
129
|
+
age: 22
|
|
130
|
+
is_disabled: true
|
|
131
|
+
is_tax_unit_spouse: true
|
|
132
|
+
person3:
|
|
133
|
+
age: 5
|
|
134
|
+
is_disabled: true
|
|
135
|
+
is_tax_unit_dependent: true
|
|
136
|
+
marital_units:
|
|
137
|
+
marital_unit:
|
|
138
|
+
members: [person1, person2]
|
|
139
|
+
spm_units:
|
|
140
|
+
spm_unit:
|
|
141
|
+
members: [person1, person2, person3]
|
|
142
|
+
households:
|
|
143
|
+
household:
|
|
144
|
+
members: [person1, person2, person3]
|
|
145
|
+
output:
|
|
146
|
+
ssi_claim_is_joint: [true, true, false]
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
period: 2022
|
|
3
3
|
input:
|
|
4
4
|
ssi_amount_if_eligible: 100
|
|
5
|
-
|
|
6
|
-
is_ssi_eligible_individual: true
|
|
5
|
+
is_ssi_eligible: true
|
|
7
6
|
ssi_countable_income: 0
|
|
8
7
|
output:
|
|
9
8
|
uncapped_ssi: 100
|
|
@@ -12,8 +11,7 @@
|
|
|
12
11
|
period: 2022
|
|
13
12
|
input:
|
|
14
13
|
ssi_amount_if_eligible: 100
|
|
15
|
-
|
|
16
|
-
is_ssi_eligible_individual: true
|
|
14
|
+
is_ssi_eligible: true
|
|
17
15
|
ssi_countable_income: 99
|
|
18
16
|
output:
|
|
19
17
|
uncapped_ssi: 1
|
|
@@ -22,28 +20,16 @@
|
|
|
22
20
|
period: 2022
|
|
23
21
|
input:
|
|
24
22
|
ssi_amount_if_eligible: 100
|
|
25
|
-
|
|
26
|
-
is_ssi_eligible_individual: true
|
|
23
|
+
is_ssi_eligible: true
|
|
27
24
|
ssi_countable_income: 101
|
|
28
25
|
output:
|
|
29
26
|
uncapped_ssi: -1
|
|
30
27
|
|
|
31
|
-
- name: Fails resource test
|
|
32
|
-
period: 2022
|
|
33
|
-
input:
|
|
34
|
-
ssi_amount_if_eligible: 100
|
|
35
|
-
meets_ssi_resource_test: false
|
|
36
|
-
is_ssi_eligible_individual: true
|
|
37
|
-
ssi_countable_income: 0
|
|
38
|
-
output:
|
|
39
|
-
uncapped_ssi: 0
|
|
40
|
-
|
|
41
28
|
- name: Not eligible
|
|
42
29
|
period: 2022
|
|
43
30
|
input:
|
|
44
31
|
ssi_amount_if_eligible: 100
|
|
45
|
-
|
|
46
|
-
is_ssi_eligible_individual: false
|
|
32
|
+
is_ssi_eligible: false
|
|
47
33
|
ssi_countable_income: 0
|
|
48
34
|
output:
|
|
49
35
|
uncapped_ssi: 0
|
|
@@ -5,7 +5,6 @@ import pandas as pd
|
|
|
5
5
|
import subprocess
|
|
6
6
|
import stat
|
|
7
7
|
from io import StringIO
|
|
8
|
-
from policyengine_us_data import CPS_2024
|
|
9
8
|
from policyengine_core.data import Dataset
|
|
10
9
|
from policyengine_core.taxbenefitsystems import TaxBenefitSystem
|
|
11
10
|
from policyengine_us import Microsimulation
|
|
@@ -284,6 +283,9 @@ class TaxSim35:
|
|
|
284
283
|
return test_str
|
|
285
284
|
|
|
286
285
|
|
|
286
|
+
DEFAULT_DATASET = "hf://policyengine/policyengine-us-data/enhanced_cps_2024.h5"
|
|
287
|
+
|
|
288
|
+
|
|
287
289
|
if __name__ == "__main__":
|
|
288
290
|
parser = ArgumentParser(description="Generate tests from TAXSIM35")
|
|
289
291
|
parser.add_argument(
|
|
@@ -299,6 +301,6 @@ if __name__ == "__main__":
|
|
|
299
301
|
taxsim = TaxSim35()
|
|
300
302
|
taxsim.OUTPUT_VARIABLES = args.outputs
|
|
301
303
|
result = taxsim.generate_from_microsimulation(
|
|
302
|
-
|
|
304
|
+
DEFAULT_DATASET, args.year, number=args.num
|
|
303
305
|
)
|
|
304
306
|
print(result)
|
|
@@ -8,6 +8,13 @@ class is_ssi_eligible(Variable):
|
|
|
8
8
|
definition_period = YEAR
|
|
9
9
|
|
|
10
10
|
def formula(person, period, parameters):
|
|
11
|
+
abd_person = person("is_ssi_aged_blind_disabled", period)
|
|
11
12
|
meets_resource_test = person("meets_ssi_resource_test", period)
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
is_qualified_noncitizen = person("is_ssi_qualified_noncitizen", period)
|
|
14
|
+
immigration_status = person("immigration_status", period)
|
|
15
|
+
is_citizen = (
|
|
16
|
+
immigration_status == immigration_status.possible_values.CITIZEN
|
|
17
|
+
)
|
|
18
|
+
meets_immigration_status = is_qualified_noncitizen | is_citizen
|
|
19
|
+
|
|
20
|
+
return abd_person & meets_resource_test & meets_immigration_status
|
|
@@ -8,14 +8,19 @@ class ssi_amount_if_eligible(Variable):
|
|
|
8
8
|
unit = USD
|
|
9
9
|
definition_period = YEAR
|
|
10
10
|
reference = "https://www.law.cornell.edu/uscode/text/42/1382#b"
|
|
11
|
+
defined_for = "is_ssi_eligible"
|
|
11
12
|
|
|
12
13
|
def formula(person, period, parameters):
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
* MONTHS_IN_YEAR
|
|
14
|
+
p = parameters(period).gov.ssa.ssi.amount
|
|
15
|
+
is_dependent = person("is_tax_unit_dependent", period)
|
|
16
|
+
head_or_spouse_amount = where(
|
|
17
|
+
person("ssi_claim_is_joint", period),
|
|
18
|
+
p.couple / 2,
|
|
19
|
+
p.individual,
|
|
21
20
|
)
|
|
21
|
+
# Adults amount is based on whether it is a joint claim
|
|
22
|
+
# Dependents always use individual amount.
|
|
23
|
+
ssi_per_month = where(
|
|
24
|
+
is_dependent, p.individual, head_or_spouse_amount
|
|
25
|
+
)
|
|
26
|
+
return ssi_per_month * MONTHS_IN_YEAR
|
|
@@ -6,17 +6,10 @@ class ssi_claim_is_joint(Variable):
|
|
|
6
6
|
entity = Person
|
|
7
7
|
label = "SSI claim is joint"
|
|
8
8
|
definition_period = YEAR
|
|
9
|
-
defined_for = "is_ssi_eligible_individual"
|
|
10
9
|
|
|
11
10
|
def formula(person, period, parameters):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# include spouses (max of 2 people), not dependents or children.
|
|
18
|
-
# Dependents would be in the same tax_unit or family, but not the same
|
|
19
|
-
# marital_unit. Marital units are defined in entities.py as:
|
|
20
|
-
# "An unmarried person, or a married and co-habiting couple."
|
|
21
|
-
num_in_marriage = person.marital_unit.nb_persons()
|
|
22
|
-
return num_in_marriage == 2
|
|
11
|
+
abd_person = person("is_ssi_aged_blind_disabled", period)
|
|
12
|
+
is_head_or_spouse = person("is_tax_unit_head_or_spouse", period)
|
|
13
|
+
eligible_person = abd_person & is_head_or_spouse
|
|
14
|
+
|
|
15
|
+
return person.marital_unit.sum(eligible_person) > 1
|
|
@@ -6,7 +6,7 @@ from policyengine_us.tools.geography.county_helpers import (
|
|
|
6
6
|
from policyengine_us.variables.household.demographic.geographic.county.county_enum import (
|
|
7
7
|
County,
|
|
8
8
|
)
|
|
9
|
-
from
|
|
9
|
+
from policyengine_us.data import ZIP_CODE_DATASET
|
|
10
10
|
from policyengine_us.tools.geography.county_helpers import (
|
|
11
11
|
load_county_fips_dataset,
|
|
12
12
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: policyengine-us
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.371.0
|
|
4
4
|
Summary: Add your description here.
|
|
5
5
|
Author-email: PolicyEngine <hello@policyengine.org>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -16,7 +16,6 @@ Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
|
16
16
|
Requires-Python: <3.14,>=3.10
|
|
17
17
|
Requires-Dist: microdf-python>=1.0.0
|
|
18
18
|
Requires-Dist: policyengine-core>=3.19.0
|
|
19
|
-
Requires-Dist: policyengine-us-data>=1.17.0
|
|
20
19
|
Requires-Dist: tqdm>=4.67.1
|
|
21
20
|
Provides-Extra: dev
|
|
22
21
|
Requires-Dist: build>=1.2.2.post1; extra == 'dev'
|
|
@@ -3,8 +3,10 @@ policyengine_us/conftest.py,sha256=E-KY6D7beTAWH40keL5E3q6NzHfiNTCQnNh3YSH-LcE,8
|
|
|
3
3
|
policyengine_us/entities.py,sha256=uRrrYvpoZhAV8y_Byb8itTAMDJhZ6JdmckIMtkr2dBI,2052
|
|
4
4
|
policyengine_us/model_api.py,sha256=0NaBw2MTB32T3SrG6uMMeZwwL-wGasWu5U-igV4jq24,1261
|
|
5
5
|
policyengine_us/modelled_policies.yaml,sha256=rbDP6Nzsu5ml2Vdwoo9oSum0msm11NMgK75E9d_FZGU,4773
|
|
6
|
-
policyengine_us/system.py,sha256=
|
|
6
|
+
policyengine_us/system.py,sha256=dzMk0_3YNcxX5e9DFVyNvXMujjZ3WGCcMTVrdfjO4Yc,10766
|
|
7
7
|
policyengine_us/typing.py,sha256=ixLAOFjSnepNEAZ63DhhBZHRw0rBgjH81y_z4hTjhEE,298
|
|
8
|
+
policyengine_us/data/__init__.py,sha256=TuwzfG1RS1KzvMptMbpbEfiaRG5RPCXQK5gYBwzDkBc,47
|
|
9
|
+
policyengine_us/data/zip_code_dataset.py,sha256=PvA4Jldyu21XEuJMGRAcNLxjlJnDSJ7iVTBdy2c1Mp8,337
|
|
8
10
|
policyengine_us/parameters/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
9
11
|
policyengine_us/parameters/calibration/gov/aca/enrollment/state.yaml,sha256=NjN2M7pJxG6q78KR3-I3cIZCVjDayrswc65RISZmetY,1794
|
|
10
12
|
policyengine_us/parameters/calibration/gov/aca/spending/state.yaml,sha256=1kvJIiu-cYEbXPAaBQcOqSE3ShXfALag-1Pdw3sdEes,2018
|
|
@@ -3512,15 +3514,16 @@ policyengine_us/tests/policy/baseline/gov/simulation/labor_supply_response/incom
|
|
|
3512
3514
|
policyengine_us/tests/policy/baseline/gov/simulation/labor_supply_response/labor_supply_behavioral_response.yaml,sha256=FqBkZcYs-EFj-pNtUAtW85ZyGn_riZ3_pH-8DP90ORU,1551
|
|
3513
3515
|
policyengine_us/tests/policy/baseline/gov/simulation/labor_supply_response/substitution_elasticity.yaml,sha256=Cfb3-vmZxtLJdDIimJsByRDqdYh1ds5lBCQVgShDDtQ,2032
|
|
3514
3516
|
policyengine_us/tests/policy/baseline/gov/ssa/ss/never_eligible_for_social_security_benefits.yaml,sha256=-l0F8L_YCNpNfwBtZLxEfPOCPea4ZHfGNAHRw3ozkYk,587
|
|
3515
|
-
policyengine_us/tests/policy/baseline/gov/ssa/ssi/integration.yaml,sha256=
|
|
3517
|
+
policyengine_us/tests/policy/baseline/gov/ssa/ssi/integration.yaml,sha256=q4L7elUM4WmlSF-J0i9rtNd_Cq3uhAvz17vpPooBfdw,1554
|
|
3516
3518
|
policyengine_us/tests/policy/baseline/gov/ssa/ssi/is_ssi_aged_blind_disabled.yaml,sha256=tyim2uGywNbV57pL2M6DO2kH1I2lXZS6P2Vab2zyIRA,470
|
|
3517
3519
|
policyengine_us/tests/policy/baseline/gov/ssa/ssi/is_ssi_disabled.yaml,sha256=6m105fmpjOism7pvcXSubXjHoiT8e7Lcfpu6NwzxuRo,1244
|
|
3518
|
-
policyengine_us/tests/policy/baseline/gov/ssa/ssi/is_ssi_eligible.yaml,sha256=
|
|
3520
|
+
policyengine_us/tests/policy/baseline/gov/ssa/ssi/is_ssi_eligible.yaml,sha256=atAjx9vbFCBWwl3zxzauS76WzE2l5YUo1szVrcC7GJY,474
|
|
3519
3521
|
policyengine_us/tests/policy/baseline/gov/ssa/ssi/is_ssi_qualified_noncitizen.yaml,sha256=QiRg3QvNVv8J1pOPzTjyWT7OBy3dkzHWMqs6Vlbincs,1124
|
|
3520
3522
|
policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi.yaml,sha256=Ou49cO_GWSCbBGlFrN3b79Xk4wnUSLPA8fwrC7NSEhk,652
|
|
3521
|
-
policyengine_us/tests/policy/baseline/gov/ssa/ssi/
|
|
3523
|
+
policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_amount_if_eligible.yaml,sha256=rDd7EeTMiS050o18i8gN5l-u1w1V1N3dh0Mcg31wWhg,3302
|
|
3524
|
+
policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_claim_is_joint.yaml,sha256=IxiCuu8BPiq2nT9AX63UCz9f5upZllr8vdb5Mwn8imE,3558
|
|
3522
3525
|
policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_countable_income.yaml,sha256=m9kaOqgr1Unn9NiJIaPHhVRoKNh-FLyvIAITcM9hmp8,3412
|
|
3523
|
-
policyengine_us/tests/policy/baseline/gov/ssa/ssi/uncapped_ssi.yaml,sha256=
|
|
3526
|
+
policyengine_us/tests/policy/baseline/gov/ssa/ssi/uncapped_ssi.yaml,sha256=oWN1uCK22O9GIal10m4QqTNJmMOWWaY-zyv68so1PVg,1031
|
|
3524
3527
|
policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/ssi_marital_both_eligible.yaml,sha256=U2uTvOy9ycwiZc1jiH4jMHl9Rsh90GDAmlxLLZEZZxE,1176
|
|
3525
3528
|
policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/is_ssi_blind_or_disabled_working_student_exclusion_eligible.yaml,sha256=ac0Zi_A3GWTLlAQnyr5WC-8whjqLbqTUsN3PP3O6nLQ,944
|
|
3526
3529
|
policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/ssi_blind_or_disabled_working_student_exclusion.yaml,sha256=zJjJKP8sn3nLxzwioPV3pi5lFJaBDGt3xJuO3gsv5KI,2006
|
|
@@ -5167,7 +5170,7 @@ policyengine_us/tools/variables.py,sha256=AcJMnvPyfCK6to2BIRNODcVcPObCbxQ8UFc8Td
|
|
|
5167
5170
|
policyengine_us/tools/geography/README.md,sha256=fxMEj9_GC9Evh1mkTTtf8WKNjZ51lbd1A2--pZKrCsY,155
|
|
5168
5171
|
policyengine_us/tools/geography/county_helpers.py,sha256=z-WqWQ5CwlnZBA2w0_LuIuU9F0zsdoHykXoWZ50jhM8,2077
|
|
5169
5172
|
policyengine_us/tools/geography/download_50_state_census_block_data.py,sha256=LFwAAufn6YpOiIMwGNbTslzh7ZjTrDT8l7FuaUqEn_c,2730
|
|
5170
|
-
policyengine_us/tools/taxsim/generate_taxsim_tests.py,sha256=
|
|
5173
|
+
policyengine_us/tools/taxsim/generate_taxsim_tests.py,sha256=8XTQgP2rvdgR5utAjDrS0tPnZQQI0gPx9gZ082GG0KU,10739
|
|
5171
5174
|
policyengine_us/variables/contrib/congress/wftca/bonus_guaranteed_deduction.py,sha256=5WWTeo4A8aSbw1vTg9jZofepvjn54LSjCnfTTVJXEWQ,896
|
|
5172
5175
|
policyengine_us/variables/contrib/taxsim/taxsim_age1.py,sha256=nlbRCCARxV5aXe7trb3d88cDwE3pZ143RBwU6eOICgs,963
|
|
5173
5176
|
policyengine_us/variables/contrib/taxsim/taxsim_age2.py,sha256=-O1GFMG7AS1L-SIlYHOzdHn9NHWp52AThv_Lf4rYa0s,552
|
|
@@ -5765,10 +5768,10 @@ policyengine_us/variables/gov/ssa/ss/social_security_dependents.py,sha256=WN5uln
|
|
|
5765
5768
|
policyengine_us/variables/gov/ssa/ss/social_security_disability.py,sha256=1Jh83oHKbP_noFnOdDq9C6gqasbzed53YM_Ue0ExXDQ,264
|
|
5766
5769
|
policyengine_us/variables/gov/ssa/ss/social_security_retirement.py,sha256=9ohBrN-yMIewjHJvxlz-3vdoqrVmmOqiomQJeqKTBqs,257
|
|
5767
5770
|
policyengine_us/variables/gov/ssa/ss/social_security_survivors.py,sha256=8GuxrIPrHN-psTjkfzp3nvrJXEmbXisKiegkvenOzUg,257
|
|
5768
|
-
policyengine_us/variables/gov/ssa/ssi/is_ssi_eligible.py,sha256=
|
|
5771
|
+
policyengine_us/variables/gov/ssa/ssi/is_ssi_eligible.py,sha256=A6Cxz_7frbiSs9V7r95h3GSw0BkHPT5jN8YtvjyFRpI,771
|
|
5769
5772
|
policyengine_us/variables/gov/ssa/ssi/ssi.py,sha256=5XIl0mU-LRa5FMzK2Dguan_FKZG6GLiT_xD1rkZBRWI,462
|
|
5770
|
-
policyengine_us/variables/gov/ssa/ssi/ssi_amount_if_eligible.py,sha256=
|
|
5771
|
-
policyengine_us/variables/gov/ssa/ssi/ssi_claim_is_joint.py,sha256=
|
|
5773
|
+
policyengine_us/variables/gov/ssa/ssi/ssi_amount_if_eligible.py,sha256=uxKoHiPPDkUVHL-l6hF-1QzhMcrLv8TOHGA2B-azOvs,884
|
|
5774
|
+
policyengine_us/variables/gov/ssa/ssi/ssi_claim_is_joint.py,sha256=NYwR2LVLV2xf1vbFG0r9ZwhQFVlZ_gLnV_F00RUU6_Y,485
|
|
5772
5775
|
policyengine_us/variables/gov/ssa/ssi/tax_unit_ssi.py,sha256=Gw8nl4n1c86m3gsEboYZ_52Mf8KurWnfnITFKRlMGCk,221
|
|
5773
5776
|
policyengine_us/variables/gov/ssa/ssi/uncapped_ssi.py,sha256=pVr8WqBmSIA0ZcoRGOIV9QrcBcKE05uq8au_B6DMfoI,511
|
|
5774
5777
|
policyengine_us/variables/gov/ssa/ssi/eligibility/income/_apply_ssi_exclusions.py,sha256=1aQNTEUuTVEEVWf_6wFN7-eCwSl4D6G9uyvzAnRBqXA,1806
|
|
@@ -7796,7 +7799,7 @@ policyengine_us/variables/household/demographic/geographic/state_group.py,sha256
|
|
|
7796
7799
|
policyengine_us/variables/household/demographic/geographic/state_group_str.py,sha256=YVapmNgz-QhCZXVfVnU72_G_fijilHLJ1kBDThX9IUE,359
|
|
7797
7800
|
policyengine_us/variables/household/demographic/geographic/state_name.py,sha256=tfpURwlCmHRJkk4m0_NVPInByKbWY0Upq7sbZUobZIs,1495
|
|
7798
7801
|
policyengine_us/variables/household/demographic/geographic/tax_unit_state.py,sha256=yQCj1TgJplNL7EGOx59C9av7isbHsyThaWheZMCjSFg,282
|
|
7799
|
-
policyengine_us/variables/household/demographic/geographic/county/county.py,sha256=
|
|
7802
|
+
policyengine_us/variables/household/demographic/geographic/county/county.py,sha256=F1gZbt5DEteQZQIe5xV-UPbWgfgCicO5BUrAZdY8HAE,2374
|
|
7800
7803
|
policyengine_us/variables/household/demographic/geographic/county/county_enum.py,sha256=2-SIpjp72QWPhQQUs8hzxrLcE2baWSkLTdCVRwKOXXw,145769
|
|
7801
7804
|
policyengine_us/variables/household/demographic/geographic/county/county_str.py,sha256=UDWJ8YqH4Ef_JTscy8LMwLAMQ_o-Zan13hziZBY3XPs,339
|
|
7802
7805
|
policyengine_us/variables/household/demographic/geographic/county/first_county_in_state.py,sha256=yXCj-LVjxPeILIg42ijefTmi_j4NxJwX0kMtoE47xic,1578
|
|
@@ -7806,7 +7809,7 @@ policyengine_us/variables/household/demographic/geographic/ucgid/ucgid.py,sha256
|
|
|
7806
7809
|
policyengine_us/variables/household/demographic/geographic/ucgid/ucgid_enum.py,sha256=dkeusTBI1j4xAGmRFkfSsyT3Hq5gHZwRUkSeISeNbx0,15636
|
|
7807
7810
|
policyengine_us/variables/household/demographic/geographic/ucgid/ucgid_str.py,sha256=GnIRg2tc0376YazPX7wm7YQgMQaYPm2Au47vc1E5JcM,914
|
|
7808
7811
|
policyengine_us/variables/household/demographic/geographic/zip_code/three_digit_zip_code.py,sha256=7q0FQRahTOINiK2vlAyHEa5xIKowM5Kgl60-kR3ZuWU,426
|
|
7809
|
-
policyengine_us/variables/household/demographic/geographic/zip_code/zip_code.py,sha256=
|
|
7812
|
+
policyengine_us/variables/household/demographic/geographic/zip_code/zip_code.py,sha256=3J8RfnIIsmw4_5gF5yZHmATt2cNskyKQR0lncCvOQx0,1691
|
|
7810
7813
|
policyengine_us/variables/household/demographic/household/bedrooms.py,sha256=4ltdIRLdmeuTKAskn4pdgxZuxEE-4rz0ffPnIKobc-o,164
|
|
7811
7814
|
policyengine_us/variables/household/demographic/household/household_count.py,sha256=f6dIPWyCtWlZ-qTSCPDrzCfINSzoJOE5Tw1ynBKYfGA,211
|
|
7812
7815
|
policyengine_us/variables/household/demographic/household/household_size.py,sha256=DR5PS9bylHlPphL3-Y0ySR4E0cavAf6qyMpNJG2N3ig,263
|
|
@@ -8253,8 +8256,8 @@ policyengine_us/variables/input/farm_income.py,sha256=BEKxYmHNNnWJAAvULl5qZJigy5
|
|
|
8253
8256
|
policyengine_us/variables/input/geography.py,sha256=XmBlgXhzBoLRKk6R8taVZHqUw1eU8MbNeGS9iJ7_l44,4506
|
|
8254
8257
|
policyengine_us/variables/input/self_employment_income.py,sha256=PwsGz8R4lRikKWUYOhsC0qosNNLXq4f5SQmfw4S3mk8,511
|
|
8255
8258
|
policyengine_us/variables/input/self_employment_income_before_lsr.py,sha256=E8fcX9Nlyqz8dziHhQv_euutdmoIwFMMWePUwbbwv_w,379
|
|
8256
|
-
policyengine_us-1.
|
|
8257
|
-
policyengine_us-1.
|
|
8258
|
-
policyengine_us-1.
|
|
8259
|
-
policyengine_us-1.
|
|
8260
|
-
policyengine_us-1.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|