updated to show T/F/null vs T/F for AML and FUDS (#1866)

This commit is contained in:
Emma Nechamkin 2022-08-24 20:22:59 -04:00 committed by GitHub
commit 637b8c305c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 40 additions and 10 deletions

View file

@ -355,9 +355,12 @@ TRANSPORTATION_COSTS = "Transportation Costs"
# eAMLIS and FUDS variables
AML_BOOLEAN = "Is there at least one abandoned mine in this census tract?"
AML_BOOLEAN_FILLED_IN = "Is there at least one abandoned mine in this census tract, where missing data is treated as False?"
ELIGIBLE_FUDS_BINARY_FIELD_NAME = (
"Is there at least one Formerly Used Defense Site (FUDS) in the tract?"
)
ELIGIBLE_FUDS_FILLED_IN_FIELD_NAME = "Is there at least one Formerly Used Defense Site (FUDS) in the tract, where missing data is treated as False?"
#####
# Names for individual factors being exceeded

View file

@ -488,13 +488,21 @@ class ScoreNarwhal(Score):
>= self.ENVIRONMENTAL_BURDEN_THRESHOLD
)
self.df[field_names.ELIGIBLE_FUDS_FILLED_IN_FIELD_NAME] = self.df[
field_names.ELIGIBLE_FUDS_BINARY_FIELD_NAME
].fillna(False)
self.df[field_names.AML_BOOLEAN_FILLED_IN] = self.df[
field_names.AML_BOOLEAN
].fillna(False)
self.df[field_names.POLLUTION_THRESHOLD_EXCEEDED] = self.df[
[
field_names.RMP_PCTILE_THRESHOLD,
field_names.NPL_PCTILE_THRESHOLD,
field_names.TSDF_PCTILE_THRESHOLD,
field_names.AML_BOOLEAN,
field_names.ELIGIBLE_FUDS_BINARY_FIELD_NAME,
field_names.AML_BOOLEAN_FILLED_IN,
field_names.ELIGIBLE_FUDS_FILLED_IN_FIELD_NAME,
]
].any(axis="columns")
@ -513,7 +521,7 @@ class ScoreNarwhal(Score):
)
self.df[field_names.AML_LOW_INCOME_FIELD] = (
self.df[field_names.AML_BOOLEAN]
self.df[field_names.AML_BOOLEAN_FILLED_IN]
& self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED]
)