Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3723efb
add usda disabled params to usda folder and add is_usda_elderly varia…
nmrodelo Nov 29, 2021
012b6fd
updated spm_unit level has_elderly_or_disabled to be solely had_disab…
nmrodelo Nov 29, 2021
1cac429
update documentation for has_usda_disabled
nmrodelo Nov 29, 2021
63ee869
remove changes to has_elderly_disabled, leave for seperate pr
nmrodelo Nov 29, 2021
4c1c7a8
move elderly defiinition from snap.py to usda.py
nmrodelo Nov 29, 2021
d3d5b4b
update variable name in usda.py
nmrodelo Nov 29, 2021
2f5afe5
Update openfisca_us/parameters/usda/usda_disabled.yaml
nmrodelo Nov 29, 2021
d0cccf5
Update openfisca_us/parameters/usda/usda_disabled.yaml
nmrodelo Nov 29, 2021
003cc4a
formatting
nmrodelo Nov 29, 2021
077f733
Merge branch 'usda_disabled' of https://github.com/nmrodelo/openfisca…
nmrodelo Nov 29, 2021
2574523
formatting updates
nmrodelo Nov 29, 2021
41011d9
re add is_disabled_or_elderly_for_snap to snap.py, rename usda_disabl…
nmrodelo Nov 29, 2021
2604397
added prelim formula
nmrodelo Nov 29, 2021
e9d1fef
add label
nmrodelo Nov 29, 2021
8ea4c89
rename disabled.yaml to disabled_programs.yaml
nmrodelo Nov 30, 2021
2c49e21
Update openfisca_us/variables/usda/usda.py
nmrodelo Nov 30, 2021
384a5d7
Merge branch 'usda_disabled' of https://github.com/nmrodelo/openfisca…
nmrodelo Nov 30, 2021
24375d3
removed units
nmrodelo Nov 30, 2021
586d84a
add formula for is_usda_disabled in usda.py
nmrodelo Nov 30, 2021
feac965
add label, formatting
nmrodelo Nov 30, 2021
6e6325e
use placeholder formula for disabled status pending clarification
nmrodelo Nov 30, 2021
c22ad47
blindess to blindness in disabled_programs.yaml
nmrodelo Dec 1, 2021
e8320d3
added legal docs
nmrodelo Dec 1, 2021
a48eb47
update disabled formula
nmrodelo Dec 1, 2021
cb8a2a1
add tests
nmrodelo Dec 1, 2021
02b667e
add disabled program variables, edit is_usda_disabled formula
nmrodelo Dec 1, 2021
d17a9a8
formula changes
nmrodelo Dec 1, 2021
37eb67e
Update openfisca_us/variables/usda/usda.py
nmrodelo Dec 1, 2021
96e1b1b
change any_ to np.any
nmrodelo Dec 1, 2021
914eaa1
update paren
nmrodelo Dec 1, 2021
7f6d708
add labels and documentation to snap.py
nmrodelo Dec 1, 2021
db6a946
add new .py files for ssi and ssdi programs, rename disabled_programs…
nmrodelo Dec 1, 2021
aa75588
rename
nmrodelo Dec 1, 2021
74b9bd5
add tests for new programs, formatting
nmrodelo Dec 1, 2021
5264cd5
Merge branch 'master' into usda_disabled
nikhilwoodruff Dec 1, 2021
1232520
add is to variable names, fix formatting in labels and documentation
nmrodelo Dec 4, 2021
3197802
Merge branch 'usda_disabled' of https://github.com/nmrodelo/openfisca…
nmrodelo Dec 4, 2021
fa64137
Update openfisca_us/variables/usda/usda.py
nmrodelo Dec 4, 2021
020182e
Merge branch 'master' into usda_disabled
nikhilwoodruff Dec 4, 2021
2b6c65d
delete redundant ccdf vars
nmrodelo Dec 4, 2021
8329eb8
add is to class names
nmrodelo Dec 4, 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
14 changes: 14 additions & 0 deletions openfisca_us/parameters/usda/disabled_programs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: Program participation that qualify individuals as disabled under USDA rules

values:
2021-01-01:
- is_ssi_disabled
- ssdi
- is_permanently_disabled_veteran
- is_surviving_spouse_of_disabled_veteran
- is_surviving_child_of_disabled_veteran

metadata:
reference:
- title: 'SNAP Special Rules for the Elderly or Disabled'
href: https://www.fns.usda.gov/snap/eligibility/elderly-disabled-special-rules#Who%20is%20elderly?
26 changes: 26 additions & 0 deletions openfisca_us/tests/policy/baseline/usda/is_usda_disabled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- name: People without any disability flags are not USDA disabled
period: 2021
input:
people:
person_1:
age: 30
output:
is_usda_disabled: False

- name: SSI disabled people are USDA disabled
period: 2021
input:
people:
person_1:
is_ssi_disabled: True
output:
is_usda_disabled: True

- name: People receiving SSDI are USDA disabled
period: 2021
input:
people:
person_1:
ssdi: 100
output:
is_usda_disabled: True
28 changes: 28 additions & 0 deletions openfisca_us/variables/demographic/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,31 @@ class is_citizen(Variable):
entity = Person
label = u"Is a U.S. citizen"
definition_period = YEAR


class is_permanently_disabled_veteran(Variable):
value_type = bool
entity = Person
definition_period = YEAR
documentation = (
"Indicates whether a person is a permanently disabled veteran"
)
label = "Permanently disabled veteran"


class is_surviving_spouse_of_disabled_veteran(Variable):
value_type = bool
entity = Person
definition_period = YEAR
documentation = "Indicates whether a person is a surviving spouse of a disabled veteran"
label = "Surviving spouse of disabled veteran"


class is_surviving_child_of_disabled_veteran(Variable):
value_type = bool
entity = Person
definition_period = YEAR
documentation = (
"Indicates whether a person is a surviving child of a disabled veteran"
)
label = "Surviving child of disabled veteran"
11 changes: 11 additions & 0 deletions openfisca_us/variables/ssa/ssdi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from openfisca_core.model_api import *
from openfisca_us.entities import *
from openfisca_us.tools.general import *


class ssdi(Variable):
value_type = float
entity = Person
definition_period = YEAR
documentation = "Social Security Disability Insurance amount"
label = "Social Security Disability Insurance"
11 changes: 11 additions & 0 deletions openfisca_us/variables/ssa/ssi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from openfisca_core.model_api import *
from openfisca_us.entities import *
from openfisca_us.tools.general import *


class is_ssi_disabled(Variable):
value_type = bool
entity = Person
definition_period = YEAR
documentation = "Indicates whether a person is disabled for the Supplemental Security Income program"
label = "SSI disabled"
37 changes: 25 additions & 12 deletions openfisca_us/variables/usda/snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ class snap_gross_income(Variable):
value_type = float
entity = SPMUnit
definition_period = YEAR
label = "SPM unit's gross income for calculating SNAP eligibility"
documentation = "Gross income for calculating SNAP eligibility"
label = "SNAP gross income"


class snap_earnings_deduction(Variable):
value_type = float
entity = SPMUnit
definition_period = YEAR
documentation = ""
documentation = "Earnings deduction for calculating SNAP benefit amount"
label = "SNAP earnings deduction"

def formula(spm_unit, period, parameters):

Expand All @@ -32,13 +34,15 @@ class is_disabled_or_elderly_for_snap(Variable):
entity = Person
definition_period = YEAR
documentation = "Indicates that a person is defined as disabled or elderly based on the USDA definition"
label = "Is disabled or elderly for SNAP"


class snap_standard_deduction(Variable):
value_type = float
entity = SPMUnit
definition_period = YEAR
documentation = ""
documentation = "Standard deduction for calculating SNAP benefit amount"
label = "SNAP standard deduction"

def formula(spm_unit, period, parameters):

Expand All @@ -56,7 +60,8 @@ class snap_net_income_pre_shelter(Variable):
value_type = float
entity = SPMUnit
definition_period = YEAR
documentation = ""
documentation = "Net income before shelter deduction, needed as intermediate to calculate shelter deduction"
label = "SNAP net income pre-shelter"

def formula(spm_unit, period, parameters):

Expand All @@ -79,7 +84,10 @@ class snap_shelter_deduction(Variable):
value_type = float
entity = SPMUnit
definition_period = YEAR
documentation = ""
documentation = (
"Excess shelter deduction for calculating SNAP benefit amount"
)
label = "SNAP shelter deduction"

def formula(spm_unit, period, parameters):
# TODO: MUltiply params by 12.
Expand Down Expand Up @@ -112,15 +120,19 @@ class has_elderly_disabled(Variable):
value_type = bool
entity = SPMUnit
label = "Has elderly disabled"
documentation = "Whether the SPM unit has elderly disabled people"
documentation = (
"Whether elderly or disabled people, per USDA definitions, are present"
)
label = "Elderly or disabled person present"
definition_period = YEAR


class snap_net_income(Variable):
value_type = float
entity = SPMUnit
definition_period = YEAR
documentation = ""
documentation = "Final net income, after all deductions"
label = "SNAP net income"

def formula(spm_unit, period, parameters):

Expand All @@ -130,11 +142,11 @@ def formula(spm_unit, period, parameters):


class snap_expected_contribution_towards_food(Variable):

value_type = float
entity = SPMUnit
definition_period = YEAR
documentation = ""
documentation = "Expected food contribution from SNAP net income"
label = "SNAP expected good contribution"

def formula(spm_unit, period, parameters):
# TODO: Use the parameter
Expand All @@ -150,7 +162,8 @@ class snap_max_benefit(Variable):
value_type = float
entity = SPMUnit
definition_period = YEAR
documentation = ""
documentation = "Maximum benefit for SPM unit, based on the state group and household size."
label = "SNAP maximum benefit"

def formula(spm_unit, period, parameters):

Expand All @@ -163,11 +176,11 @@ def formula(spm_unit, period, parameters):


class snap(Variable):

value_type = float
entity = SPMUnit
definition_period = YEAR
documentation = ""
documentation = "Final SNAP benefit amount, equal to net income minus food contribution"
label = "SNAP benefit amount"

def formula(spm_unit, period, parameters):
# TODO: Add gross and net income checks.
Expand Down
17 changes: 17 additions & 0 deletions openfisca_us/variables/usda/usda.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
from openfisca_us.tools.general import *


class is_usda_disabled(Variable):
value_type = bool
entity = Person
definition_period = YEAR
documentation = "Disabled according to USDA criteria"
label = "USDA disabled status"

def formula(person, period, parameters):
disabled_programs = parameters(period).usda.disabled_programs

return where(
np.any([person(program, period) for program in disabled_programs]),
1,
0,
)


class is_usda_elderly(Variable):
value_type = bool
entity = Person
Expand Down