Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f6cb3b9
add snap minimum benefit params
nmrodelo Nov 24, 2021
8b41b6c
remove "main" nesting, as there is only one rate
nmrodelo Nov 24, 2021
6f73940
remove hanging period
nmrodelo Nov 24, 2021
888f54a
removed unecessary geo nestings, update unit, update description
nmrodelo Nov 24, 2021
f5c6f07
add minimum benefit calculation to snap.py, update minimum benefit d…
nmrodelo Nov 24, 2021
a242501
Merge branch 'master' of https://github.com/UBICenter/openfisca-us in…
nmrodelo Nov 27, 2021
d36f1e1
add max household size param to min benefit
nmrodelo Nov 27, 2021
db1b2ee
clean up old to-dos in SNAP standard deduction test file
nmrodelo Nov 29, 2021
4dc09cc
further formatting updates to standard deduction test file
nmrodelo Nov 29, 2021
a89ed58
add minimum_benefit test for 2 person household, notes on calcl
nmrodelo Nov 29, 2021
3319b45
added family of 3 example
nmrodelo Nov 29, 2021
82c5378
Merge branch 'master' of https://github.com/PolicyEngine/openfisca-us…
nmrodelo Dec 4, 2021
28125b3
Co-authored-by: Max Ghenis <mghenis@gmail.com> clean up tests, sepera…
nmrodelo Dec 4, 2021
8dab92e
redo var logic, edit tests accordingly
nmrodelo Dec 4, 2021
d3aa812
remove max benefit form snap formula
nmrodelo Dec 4, 2021
6a57d86
value to values
nmrodelo Dec 4, 2021
717a4d5
Fix SNAP parameter call
MaxGhenis Dec 4, 2021
84a0f8f
Simplify test comments
MaxGhenis Dec 4, 2021
298dfcd
Add comments to snap_minimum_benefit function
MaxGhenis Dec 4, 2021
6f5638a
Clean up Python
MaxGhenis Dec 4, 2021
b4140fa
Try values instead of value in parameter file
MaxGhenis Dec 4, 2021
777e528
Split minimum_benefit.yaml into separate parameter files
MaxGhenis Dec 4, 2021
c4417d2
remove period from descriptions
MaxGhenis Dec 4, 2021
0440b43
Update openfisca_us/variables/usda/snap.py
nmrodelo Dec 12, 2021
8348f31
test
nmrodelo Dec 12, 2021
5815ef8
undo test
nmrodelo Dec 12, 2021
59e8eba
Merge branch 'master' of https://github.com/PolicyEngine/openfisca-us…
nmrodelo Dec 12, 2021
a2f6278
add new min benefit file
nmrodelo Dec 12, 2021
0edbf2c
edit file name, mulitply by 12 in min_benefit.py variable
nmrodelo Dec 12, 2021
fc63022
remove * 12 from snap.py and min_benefit.py
nmrodelo Dec 12, 2021
0fdd285
test
nmrodelo Dec 12, 2021
7644746
test with * 12
nmrodelo Dec 12, 2021
6bdfae2
mulitiply by 12 in min benefit
nmrodelo Dec 18, 2021
521a6ac
Merge branch 'master' into snap_min_benefit
nikhilwoodruff Dec 18, 2021
7e71510
min to minimum in snap.py
nmrodelo Dec 25, 2021
c196040
Merge remote-tracking branch 'upstream/master' into snap_min_benefit
nmrodelo Dec 25, 2021
3128ca8
remove unecessary members nesting
nmrodelo Dec 25, 2021
da931dd
add proper spm and household nestings into min benefit
nmrodelo Dec 25, 2021
6537473
rename min_benefit snap_min_benefit
nmrodelo Dec 25, 2021
05a5920
Merge remote-tracking branch 'upstream/master' into snap_min_benefit
nmrodelo Dec 25, 2021
25a2b70
update version
nmrodelo Dec 25, 2021
150e712
Update setup.py
MaxGhenis Dec 25, 2021
6367425
Merge branch 'master' into snap_min_benefit
nikhilwoodruff Dec 26, 2021
e6c4028
Merge branch 'master' of https://github.com/policyengine/openfisca-us…
nikhilwoodruff Dec 28, 2021
b0455f3
Update changelog
nikhilwoodruff Dec 28, 2021
09d39e0
Merge branch 'master' of https://github.com/policyengine/openfisca-us…
nikhilwoodruff Dec 28, 2021
d1b7e8b
Bump version
nikhilwoodruff Dec 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@
## 0.7.0

* Added Gains Tax (capital gains treatment) logic and parameters

### 0.8.0

* Added minimum benefit logic for SNAP
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: Maximum household size for SNAP minimum benefits

values:
2021-01-01: 2

metadata:
unit: persons
reference:
- title: '7 CFR § 273.10 - Determining household eligibility and benefit levels.'
href: https://www.law.cornell.edu/cfr/text/7/273.10#e_2_ii_C
10 changes: 10 additions & 0 deletions openfisca_us/parameters/usda/snap/minimum_benefit/rate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: Minimum SNAP benefit as a fraction of maximum benefit

values:
2021-01-01: 0.08

metadata:
unit: /1
reference:
- title: '7 CFR § 273.10 - Determining household eligibility and benefit levels.'
href: https://www.law.cornell.edu/cfr/text/7/273.10#e_2_ii_C
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: In calculating a SNAP minimum benefit, the household size to look up the relevant maximum benefit

values:
2021-01-01: 1

metadata:
unit: persons
reference:
- title: '7 CFR § 273.10 - Determining household eligibility and benefit levels.'
href: https://www.law.cornell.edu/cfr/text/7/273.10#e_2_ii_C
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
- name: Family of 2
period: 2022
absolute_error_margin: 0.01
input:
people:
person_1:
age: 30
person_2:
age: 50
spm_units:
spm_unit:
members: [person_1, person_2]
households:
household:
state_group: CONTIGUOUS_US
output:
# Eligible as a family of 2.
# $204/mo is the maximum SNAP benefit for 1-person households in the
# contiguous US.
snap_minimum_benefit: 204 * 0.08 * 12


- name: Family of 3
period: 2022
absolute_error_margin: 0.01
input:
people:
person_1:
age: 30
person_2:
age: 50
person_3:
age: 35
spm_units:
spm_unit:
members: [person_1, person_2, person_3]
households:
household:
state_group: CONTIGUOUS_US
output:
# Ineligible as a family of 3.
snap_minimum_benefit: 0
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# looks up from snap_standard_deduction.yaml based on state and Family size
# TODO: rename all files basically with snap in front
# add snap in front of variable names
# multiply gross income by 12
# rename income to gross income
# create snap gross income variable
# make sure items under metadata are indented properly for all files
# add household nesting for GU, VI, AK, HI, etc. non contiguous

- name: Family of 4, income of 24k/year (Standard Test)
period: 2021
absolute_error_margin: 0.01
Expand Down
31 changes: 22 additions & 9 deletions openfisca_us/variables/usda/snap/min_benefit.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
from openfisca_us.model_api import *


class snap_min_benefit(Variable):
class snap_minimum_benefit(Variable):
value_type = float
entity = SPMUnit
label = "SNAP minimum benefit"
unit = "currency-USD"
documentation = "The SNAP entitlement that would be required to meet the minimum benefit requirement."
definition_period = YEAR
label = "Minimum benefit for SNAP"

def formula(spm_unit, period, parameters):
under_three_members = spm_unit.nb_persons() <= 2
single_person_max = parameters(period).usda.snap.amount.main[
spm_unit.household("state_group_str", period)
]["1"]
return under_three_members * single_person_max * 0.08
# Parameters for the minimum benefit.
snap = parameters(period).usda.snap
min_benefit = snap.minimum_benefit
# Calculate the relevant maximum benefit, defined as the maximum
# benefit for a household of a certain size in their state.
state_group = spm_unit.household("state_group_str", period)
relevant_max_benefit = (
snap.amount.main[state_group][
str(min_benefit.relevant_max_benefit_household_size)
]
* 12
)
# Minimum benefits only apply to households up to a certain size.
household_size = spm_unit.nb_persons()
min_share_of_max = where(
household_size <= min_benefit.maximum_household_size,
min_benefit.rate,
0,
)
return relevant_max_benefit * min_share_of_max
2 changes: 1 addition & 1 deletion openfisca_us/variables/usda/snap/snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ def formula(spm_unit, period):
eligible = spm_unit("is_snap_eligible", period)
expected_contribution = spm_unit("snap_expected_contribution", period)
return eligible * max_(
spm_unit("snap_min_benefit", period),
spm_unit("snap_minimum_benefit", period),
spm_unit("snap_max_benefit", period) - expected_contribution,
)
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="OpenFisca-US",
version="0.7.0",
version="0.8.0",
author="Nikhil Woodruff",
author_email="nikhil@policyengine.org",
classifiers=[
Expand Down Expand Up @@ -51,9 +51,7 @@
},
python_requires=">=3.7,<3.8",
entry_points={
"console_scripts": [
"openfisca-us = openfisca_us.tools.cli:main",
],
"console_scripts": ["openfisca-us = openfisca_us.tools.cli:main"],
},
packages=find_packages(),
)