Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds UST indicator #1786

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion data/data-pipeline/data_pipeline/content/config/csv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,13 @@ fields:
format: bool
- score_name: Percent of population not currently enrolled in college or graduate school
label: Percent of residents who are not currently enrolled in higher ed
format: percentage
format: percentage
- score_name: Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?
label: Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?
format: bool
- score_name: Leaky underground storage tanks (percentile)
label: Leaky underground storage tanks (percentile)
format: percentage
- score_name: Leaky underground storage tanks
label: Leaky underground storage tanks
format: float
9 changes: 9 additions & 0 deletions data/data-pipeline/data_pipeline/content/config/excel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,21 @@ sheets:
- score_name: Greater than or equal to the 90th percentile for wastewater discharge, is low income, and has a low percent of higher ed students?
label: Greater than or equal to the 90th percentile for wastewater discharge, is low income, and has a low percent of higher ed students?
format: bool
- score_name: Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?
label: Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?
format: bool
- score_name: Wastewater discharge (percentile)
label: Wastewater discharge (percentile)
format: percentage
- score_name: Leaky underground storage tanks (percentile)
label: Leaky underground storage tanks (percentile)
format: percentage
- score_name: Wastewater discharge
label: Wastewater discharge
format: float
- score_name: Leaky underground storage tanks
label: Leaky underground storage tanks
format: float
- score_name: Greater than or equal to the 90th percentile for asthma, is low income, and has a low percent of higher ed students?
label: Greater than or equal to the 90th percentile for asthma, is low income, and has a low percent of higher ed students?
format: bool
Expand Down
4 changes: 4 additions & 0 deletions data/data-pipeline/data_pipeline/etl/score/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@
+ field_names.PERCENTILE_FIELD_SUFFIX: "UF_PFS",
field_names.WASTEWATER_FIELD
+ field_names.PERCENTILE_FIELD_SUFFIX: "WF_PFS",
field_names.UST_FIELD
+ field_names.PERCENTILE_FIELD_SUFFIX: "UST_PFS",
field_names.M_WATER: "M_WTR",
field_names.M_WORKFORCE: "M_WKFC",
field_names.M_CLIMATE: "M_CLT",
Expand All @@ -220,6 +222,7 @@
field_names.SUPERFUND_LOW_INCOME_LOW_HIGHER_ED_FIELD: "SFLI",
field_names.HAZARDOUS_WASTE_LOW_INCOME_LOW_HIGHER_ED_FIELD: "HWLI",
field_names.WASTEWATER_DISCHARGE_LOW_INCOME_LOW_HIGHER_ED_FIELD: "WDLI",
field_names.UST_LOW_INCOME_FIELD: "USTLI",
field_names.DIABETES_LOW_INCOME_LOW_HIGHER_ED_FIELD: "DLI",
field_names.ASTHMA_LOW_INCOME_LOW_HIGHER_ED_FIELD: "ALI",
field_names.HEART_DISEASE_LOW_INCOME_LOW_HIGHER_ED_FIELD: "HDLI",
Expand All @@ -242,6 +245,7 @@
field_names.NPL_PCTILE_THRESHOLD: "NPL_ET",
field_names.TSDF_PCTILE_THRESHOLD: "TSDF_ET",
field_names.WASTEWATER_PCTILE_THRESHOLD: "WD_ET",
field_names.UST_PCTILE_THRESHOLD: "UST_ET",
field_names.DIABETES_PCTILE_THRESHOLD: "DB_ET",
field_names.ASTHMA_PCTILE_THRESHOLD: "A_ET",
field_names.HEART_DISEASE_PCTILE_THRESHOLD: "HD_ET",
Expand Down
1 change: 1 addition & 0 deletions data/data-pipeline/data_pipeline/etl/score/etl_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ def _prepare_initial_df(self) -> pd.DataFrame:
field_names.NPL_FIELD,
field_names.WASTEWATER_FIELD,
field_names.LEAD_PAINT_FIELD,
field_names.UST_FIELD,
field_names.UNDER_5_FIELD,
field_names.OVER_64_FIELD,
field_names.LINGUISTIC_ISO_FIELD,
Expand Down
6 changes: 5 additions & 1 deletion data/data-pipeline/data_pipeline/score/field_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
NPL_FIELD = "Proximity to NPL sites"
AIR_TOXICS_CANCER_RISK_FIELD = "Air toxics cancer risk"
RESPIRATORY_HAZARD_FIELD = "Respiratory hazard index"
UST_FIELD = "Underground storage tanks"
UST_FIELD = "Leaky underground storage tanks"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emma-nechamkin and @KameronKerger - can these also be used for the sidepanel copy?


LOW_INCOME_THRESHOLD = "Exceeds FPL200 threshold"

Expand Down Expand Up @@ -430,6 +430,8 @@

# 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?"


# Health Burdens
DIABETES_LOW_INCOME_FIELD = f"Greater than or equal to the {PERCENTILE}th percentile for diabetes and is low income?"
Expand Down Expand Up @@ -629,6 +631,8 @@
NPL_PCTILE_THRESHOLD = f"Greater than or equal to the {PERCENTILE}th percentile for NPL (superfund sites) proximity"
TSDF_PCTILE_THRESHOLD = f"Greater than or equal to the {PERCENTILE}th percentile for proximity to hazardous waste sites"
WASTEWATER_PCTILE_THRESHOLD = f"Greater than or equal to the {PERCENTILE}th percentile for wastewater discharge"
UST_PCTILE_THRESHOLD = f"Greater than or equal to the {PERCENTILE}th percentile for leaky underwater storage tanks"

DIABETES_PCTILE_THRESHOLD = (
f"Greater than or equal to the {PERCENTILE}th percentile for diabetes"
)
Expand Down
33 changes: 26 additions & 7 deletions data/data-pipeline/data_pipeline/score/score_narwhal.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,23 +443,42 @@ def _water_factor(self) -> bool:
]
>= self.ENVIRONMENTAL_BURDEN_THRESHOLD
)

# Straight copy here in case we add additional water fields.
self.df[field_names.WATER_THRESHOLD_EXCEEDED] = self.df[
field_names.WASTEWATER_PCTILE_THRESHOLD
].copy()
self.df[field_names.UST_PCTILE_THRESHOLD] = (
self.df[field_names.UST_FIELD + field_names.PERCENTILE_FIELD_SUFFIX]
>= self.ENVIRONMENTAL_BURDEN_THRESHOLD
)

self.df[field_names.WASTEWATER_DISCHARGE_LOW_INCOME_FIELD] = (
self.df[field_names.WASTEWATER_PCTILE_THRESHOLD]
& self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED]
)

self.df[field_names.UST_LOW_INCOME_FIELD] = (
self.df[field_names.UST_PCTILE_THRESHOLD]
& self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED]
)

self.df[field_names.WATER_THRESHOLD_EXCEEDED] = self.df[
[
field_names.WASTEWATER_PCTILE_THRESHOLD,
field_names.UST_PCTILE_THRESHOLD,
]
].max(axis=1)

self._increment_total_eligibility_exceeded(
[field_names.WASTEWATER_DISCHARGE_LOW_INCOME_FIELD],
[
field_names.WASTEWATER_DISCHARGE_LOW_INCOME_FIELD,
field_names.UST_LOW_INCOME_FIELD,
],
skip_fips=constants.DROP_FIPS_FROM_NON_WTD_THRESHOLDS,
)

return self.df[field_names.WASTEWATER_DISCHARGE_LOW_INCOME_FIELD]
return self.df[
[
field_names.WASTEWATER_DISCHARGE_LOW_INCOME_FIELD,
field_names.UST_LOW_INCOME_FIELD,
]
].any(axis=1)

def _health_factor(self) -> bool:
# In Xth percentile or above for diabetes (Source: CDC Places)
Expand Down