-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/PolicyEngine/policyengine-us
- Loading branch information
Showing
11 changed files
with
163 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
policyengine_us/parameters/gov/contrib/snap/abolish_deductions/in_effect.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
description: SNAP deductions are abolished, if this is true. | ||
metadata: | ||
unit: bool | ||
period: year | ||
label: Abolish SNAP deductions in effect | ||
|
||
values: | ||
0000-01-01: false |
8 changes: 8 additions & 0 deletions
8
policyengine_us/parameters/gov/contrib/snap/abolish_net_income_test/in_effect.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
description: SNAP net income test is abolished, if this is true. | ||
metadata: | ||
unit: bool | ||
period: year | ||
label: Abolish SNAP net income test in effect | ||
|
||
values: | ||
0000-01-01: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .abolish_snap_deductions import ( | ||
create_abolish_snap_deductions_reform, | ||
) | ||
from .abolish_snap_net_income_test import ( | ||
create_abolish_snap_net_income_test_reform, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from policyengine_us.model_api import * | ||
|
||
|
||
def create_abolish_snap_deductions() -> Reform: | ||
class snap_deductions(Variable): | ||
value_type = float | ||
entity = SPMUnit | ||
label = "SNAP income deductions" | ||
unit = USD | ||
documentation = "Deductions made from gross income for SNAP benefits" | ||
definition_period = MONTH | ||
reference = "https://www.law.cornell.edu/uscode/text/7/2014#e" | ||
|
||
def formula(spm_unit, period, parameters): | ||
return 0 | ||
|
||
class reform(Reform): | ||
def apply(self): | ||
self.update_variable(snap_deductions) | ||
|
||
return reform | ||
|
||
|
||
def create_abolish_snap_deductions_reform( | ||
parameters, period, bypass: bool = False | ||
): | ||
if bypass: | ||
return create_abolish_snap_deductions() | ||
|
||
p = parameters(period).gov.contrib.snap.abolish_deductions | ||
|
||
if p.in_effect: | ||
return create_abolish_snap_deductions() | ||
else: | ||
return None | ||
|
||
|
||
abolish_snap_deductions = create_abolish_snap_deductions_reform( | ||
None, None, bypass=True | ||
) |
42 changes: 42 additions & 0 deletions
42
policyengine_us/reforms/snap/abolish_snap_net_income_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from policyengine_us.model_api import * | ||
|
||
|
||
def create_abolish_snap_net_income_test() -> Reform: | ||
class meets_snap_net_income_test(Variable): | ||
value_type = bool | ||
entity = SPMUnit | ||
label = "Meets SNAP net income test" | ||
documentation = "Whether this SPM unit meets the SNAP net income test" | ||
definition_period = MONTH | ||
reference = ( | ||
"https://www.law.cornell.edu/uscode/text/7/2017#a", | ||
"https://www.law.cornell.edu/uscode/text/7/2014#c", | ||
) | ||
|
||
def formula(spm_unit, period, parameters): | ||
return True | ||
|
||
class reform(Reform): | ||
def apply(self): | ||
self.update_variable(meets_snap_net_income_test) | ||
|
||
return reform | ||
|
||
|
||
def create_abolish_snap_net_income_test_reform( | ||
parameters, period, bypass: bool = False | ||
): | ||
if bypass: | ||
return create_abolish_snap_net_income_test() | ||
|
||
p = parameters(period).gov.contrib.snap.abolish_net_income_test | ||
|
||
if p.in_effect: | ||
return create_abolish_snap_net_income_test() | ||
else: | ||
return None | ||
|
||
|
||
abolish_snap_net_income_test = create_abolish_snap_net_income_test_reform( | ||
None, None, bypass=True | ||
) |
17 changes: 17 additions & 0 deletions
17
policyengine_us/tests/policy/contrib/snap/abolish_snap_deductions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- name: Reform not in effect | ||
period: 2024 | ||
input: | ||
snap_standard_deduction: 3_000 | ||
snap_child_support_deduction: 1_000 | ||
output: | ||
snap_deductions: 4_000 | ||
|
||
- name: Reform in effect | ||
period: 2024 | ||
reforms: policyengine_us.reforms.snap.abolish_snap_deductions.abolish_snap_deductions | ||
input: | ||
gov.contrib.snap.abolish_deductions.in_effect: true | ||
snap_standard_deduction: 3_000 | ||
snap_child_support_deduction: 1_000 | ||
output: | ||
snap_deductions: 0 |
15 changes: 15 additions & 0 deletions
15
policyengine_us/tests/policy/contrib/snap/abolish_snap_net_income_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- name: Reform not in effect | ||
period: 2024 | ||
input: | ||
snap_net_income_fpg_ratio: 1.5 | ||
output: | ||
meets_snap_net_income_test: false | ||
|
||
- name: Reform in effect | ||
period: 2024 | ||
reforms: policyengine_us.reforms.snap.abolish_snap_net_income_test.abolish_snap_net_income_test | ||
input: | ||
gov.contrib.snap.abolish_net_income_test.in_effect: true | ||
snap_net_income_fpg_ratio: 1.5 | ||
output: | ||
meets_snap_net_income_test: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
setup( | ||
name="policyengine-us", | ||
version="1.165.0", | ||
version="1.166.0", | ||
author="PolicyEngine", | ||
author_email="[email protected]", | ||
long_description=readme, | ||
|