Add median house value to Definition L (#882)

* Added house value to ETL

* Adding house value to score formula and comp tool
This commit is contained in:
Lucas Merrill Brown 2021-11-13 10:29:23 -05:00 committed by GitHub
commit 05ebf9b48c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 90 additions and 48 deletions

View file

@ -114,6 +114,8 @@ OVER_64_FIELD = "Individuals over 64 years old"
# Urban Rural Map
URBAN_HERUISTIC_FIELD = "Urban Heuristic Flag"
# Housing value
MEDIAN_HOUSE_VALUE_FIELD = "Median value ($) of owner-occupied housing units"
# EJSCREEN Areas of Concern
EJSCREEN_AREAS_OF_CONCERN_NATIONAL_70TH_PERCENTILE_COMMUNITIES_FIELD_NAME = (

View file

@ -11,6 +11,7 @@ class ScoreL(Score):
def __init__(self, df: pd.DataFrame) -> None:
self.LOW_INCOME_THRESHOLD: float = 0.65
self.ENVIRONMENTAL_BURDEN_THRESHOLD: float = 0.90
self.MEDIAN_HOUSE_VALUE_THRESHOLD: float = 0.90
super().__init__(df)
def add_columns(self) -> pd.DataFrame:
@ -135,8 +136,12 @@ class ScoreL(Score):
) & transportation_criteria
def _housing_factor(self) -> bool:
# (
# In Xth percentile or above for lead paint (Source: Census's American Community Surveys
# percent of housing units built pre-1960, used as an indicator of potential lead paint exposure in homes)
# AND
# In Yth percentile or below for Median House Value (Source: Census's American Community Survey)
# )
# or
# In Xth percentile or above for housing cost burden (Source: HUD's Comprehensive Housing Affordability Strategy dataset
# AND
@ -144,11 +149,20 @@ class ScoreL(Score):
# of households where household income is less than or equal to twice the federal
# poverty level. Source: Census's American Community Survey]
housing_criteria = (
self.df[
field_names.LEAD_PAINT_FIELD
+ field_names.PERCENTILE_FIELD_SUFFIX
]
> self.ENVIRONMENTAL_BURDEN_THRESHOLD
(
self.df[
field_names.LEAD_PAINT_FIELD
+ field_names.PERCENTILE_FIELD_SUFFIX
]
> self.ENVIRONMENTAL_BURDEN_THRESHOLD
)
& (
self.df[
field_names.MEDIAN_HOUSE_VALUE_FIELD
+ field_names.PERCENTILE_FIELD_SUFFIX
]
< self.MEDIAN_HOUSE_VALUE_THRESHOLD
)
) | (
self.df[
field_names.HOUSING_BURDEN_FIELD