Adding eamlis and fuds data to legacy pollution in score (#1832)

Update to add EAMLIS and FUDS data to score
This commit is contained in:
Emma Nechamkin 2022-08-18 13:32:29 -04:00 committed by GitHub
commit cb4866b93f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 93 additions and 24 deletions

View file

@ -340,6 +340,12 @@ MOBILE_HOME = "Mobile Home"
SINGLE_PARENT = "Single Parent"
TRANSPORTATION_COSTS = "Transportation Costs"
# eAMLIS and FUDS variables
AML_BOOLEAN = "Is there at least one abandoned mine in this census tract?"
ELIGIBLE_FUDS_BINARY_FIELD_NAME = (
"Is there at least one Formerly Used Defense Site (FUDS) in the tract?"
)
#####
# Names for individual factors being exceeded
@ -399,6 +405,10 @@ HAZARDOUS_WASTE_LOW_INCOME_FIELD = (
f" for proximity to hazardous waste facilities and is low income?"
)
AML_LOW_INCOME_FIELD = "There is at least one abandoned mine in this census tract and the tract is low income."
ELIGIBLE_FUDS_LOW_INCOME_FIELD = "There is at least one Formerly Used Defense Site (FUDS) in the tract and the tract is low income."
# Critical Clean Water and Waste Infrastructure
WASTEWATER_DISCHARGE_LOW_INCOME_FIELD = f"Greater than or equal to the {PERCENTILE}th percentile for wastewater discharge and is low income?"
UST_LOW_INCOME_FIELD = f"Greater than or equal to the {PERCENTILE}th percentile for leaky underground storage tanks and is low income?"

View file

@ -464,6 +464,8 @@ class ScoreNarwhal(Score):
field_names.RMP_LOW_INCOME_FIELD,
field_names.SUPERFUND_LOW_INCOME_FIELD,
field_names.HAZARDOUS_WASTE_LOW_INCOME_FIELD,
field_names.AML_LOW_INCOME_FIELD,
field_names.ELIGIBLE_FUDS_LOW_INCOME_FIELD,
]
self.df[field_names.RMP_PCTILE_THRESHOLD] = (
@ -483,10 +485,15 @@ class ScoreNarwhal(Score):
>= self.ENVIRONMENTAL_BURDEN_THRESHOLD
)
self.df[field_names.POLLUTION_THRESHOLD_EXCEEDED] = (
self.df[field_names.RMP_PCTILE_THRESHOLD]
| self.df[field_names.NPL_PCTILE_THRESHOLD]
) | self.df[field_names.TSDF_PCTILE_THRESHOLD]
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,
]
].any(axis="columns")
# individual series-by-series
self.df[field_names.RMP_LOW_INCOME_FIELD] = (
@ -502,6 +509,16 @@ class ScoreNarwhal(Score):
& self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED]
)
self.df[field_names.AML_LOW_INCOME_FIELD] = (
self.df[field_names.AML_BOOLEAN]
& self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED]
)
self.df[field_names.ELIGIBLE_FUDS_LOW_INCOME_FIELD] = (
self.df[field_names.ELIGIBLE_FUDS_BINARY_FIELD_NAME]
& self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED]
)
self._increment_total_eligibility_exceeded(
pollution_eligibility_columns,
skip_fips=constants.DROP_FIPS_FROM_NON_WTD_THRESHOLDS,