From e4ee6e00d0de3eeba714e43bbd7488a5de373b60 Mon Sep 17 00:00:00 2001 From: Colton Leese Date: Sun, 28 Jul 2024 10:36:59 -0700 Subject: [PATCH] trying again --- .../state_suplement/co_state_supplement_eligible.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fiscalsim_us/variables/gov/states/co/ssa/state_suplement/co_state_supplement_eligible.py b/fiscalsim_us/variables/gov/states/co/ssa/state_suplement/co_state_supplement_eligible.py index d134f9602..51d766304 100644 --- a/fiscalsim_us/variables/gov/states/co/ssa/state_suplement/co_state_supplement_eligible.py +++ b/fiscalsim_us/variables/gov/states/co/ssa/state_suplement/co_state_supplement_eligible.py @@ -12,8 +12,18 @@ def formula(person, period, parameters): ssi_eligible = person("is_ssi_eligible_individual", period) is_disabled = person("is_ssi_disabled", period) is_blind = person("is_blind", period) - disabled_or_blind = is_disabled | is_blind age = person("age", period) p = parameters(period).gov.states.co.ssa.state_supplement + + # Handle potential None or NaN values + ssi_eligible = np.nan_to_num(ssi_eligible, nan=False) + is_disabled = np.nan_to_num(is_disabled, nan=False) + is_blind = np.nan_to_num(is_blind, nan=False) + + disabled_or_blind = is_disabled | is_blind in_age_range = p.age_range.calc(age) + + # Handle potential None or NaN in in_age_range + in_age_range = np.nan_to_num(in_age_range, nan=False) + return disabled_or_blind & ssi_eligible & in_age_range