File tree Expand file tree Collapse file tree
policyengine_us_data/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 }
3535)
3636
37+ # These variables have fallback formulas in policyengine-us for hand-authored
38+ # simulations, but enhanced datasets intentionally export stronger source-data
39+ # inputs that should override the fallback.
40+ DATA_OVERRIDABLE_COMPUTED_EXPORT_VARIABLES = frozenset (
41+ {
42+ "meets_ssi_disability_criteria" ,
43+ }
44+ )
45+
46+ ALLOWED_COMPUTED_EXPORT_VARIABLES = (
47+ STRUCTURAL_COMPUTED_EXPORT_VARIABLES | DATA_OVERRIDABLE_COMPUTED_EXPORT_VARIABLES
48+ )
49+
3750AUXILIARY_ENTITY_PREFIXES = {
3851 "person_" : "person" ,
3952 "tax_unit_" : "tax_unit" ,
@@ -101,7 +114,7 @@ def computed_policyengine_us_variables_for_period(
101114
102115 computed = set ()
103116 for variable_name in variable_names :
104- if variable_name in STRUCTURAL_COMPUTED_EXPORT_VARIABLES :
117+ if variable_name in ALLOWED_COMPUTED_EXPORT_VARIABLES :
105118 continue
106119 variable = tax_benefit_system .variables .get (variable_name )
107120 if variable is None :
Original file line number Diff line number Diff line change @@ -248,6 +248,13 @@ def test_final_export_contract_rejects_computed_ss_total(self):
248248 with pytest .raises (DatasetContractError , match = "social_security" ):
249249 ExtendedCPS ._assert_no_computed_variables_exported (data , 2024 )
250250
251+ def test_final_export_contract_allows_data_overridden_ssi_disability_criteria (
252+ self ,
253+ ):
254+ data = {"meets_ssi_disability_criteria" : {2024 : np .array ([True , False ])}}
255+
256+ ExtendedCPS ._assert_no_computed_variables_exported (data , 2024 )
257+
251258 def test_rename_imputed_to_inputs_maps_medicare_enrollment_to_take_up_input (self ):
252259 data = {"medicare_enrolled" : {2024 : np .array ([True , False ])}}
253260
You can’t perform that action at this time.
0 commit comments