Skip to content

Commit 76e4039

Browse files
baogorekclaude
andcommitted
Convert WIC float draws to bools to match other takeup variables
Remove draw variables; would_claim_wic and wic_nutritional_risk_imputed are now simple data-read bools. is_wic_at_nutritional_risk gates imputed risk on having a valid WIC category. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent acba168 commit 76e4039

5 files changed

Lines changed: 13 additions & 28 deletions

File tree

policyengine_us/variables/gov/usda/wic/is_wic_at_nutritional_risk.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ class is_wic_at_nutritional_risk(Variable):
1010
reference = "https://www.law.cornell.edu/uscode/text/42/1786#b_8"
1111

1212
def formula(person, period, parameters):
13-
draw = person("wic_nutritional_risk_draw", period)
1413
wic_reported = person("receives_wic", period)
14+
imputed_risk = person("wic_nutritional_risk_imputed", period)
1515
category = person("wic_category", period)
16-
risk = parameters(period).gov.usda.wic.nutritional_risk
17-
imputed_risk = draw < risk[category]
18-
return wic_reported | imputed_risk
16+
has_wic_category = category != category.possible_values.NONE
17+
return wic_reported | (imputed_risk & has_wic_category)

policyengine_us/variables/gov/usda/wic/wic_nutritional_risk_draw.py

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from policyengine_us.model_api import *
2+
3+
4+
class wic_nutritional_risk_imputed(Variable):
5+
value_type = bool
6+
entity = Person
7+
label = "Imputed WIC nutritional risk"
8+
definition_period = MONTH
9+
default_value = True

policyengine_us/variables/gov/usda/wic/wic_takeup_draw.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

policyengine_us/variables/gov/usda/wic/would_claim_wic.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,4 @@ class would_claim_wic(Variable):
66
entity = Person
77
label = "Would claim WIC"
88
definition_period = MONTH
9-
10-
def formula(person, period, parameters):
11-
draw = person("wic_takeup_draw", period)
12-
category = person("wic_category", period)
13-
takeup = parameters(period).gov.usda.wic.takeup
14-
return draw < takeup[category]
9+
default_value = True

0 commit comments

Comments
 (0)