Merge branch 'emma-nechamkin/release/score-narwhal' of github.com:usds/justice40-tool into emma-nechamkin/release/score-narwhal

This commit is contained in:
Emma Nechamkin 2022-09-15 12:07:40 -04:00
commit fe4e8e52d2

View file

@ -579,12 +579,17 @@ class ScoreETL(ExtractTransformLoad):
f"Dropping {len(drop_tracts)} tracts from Linguistic Isolation" f"Dropping {len(drop_tracts)} tracts from Linguistic Isolation"
) )
elif numeric_column == field_names.DOT_TRAVEL_BURDEN_FIELD: elif numeric_column in [
field_names.DOT_TRAVEL_BURDEN_FIELD,
field_names.EXPECTED_POPULATION_LOSS_RATE_FIELD,
]:
# Not having any people appears to be correlated with transit burden, but also doesn't represent # Not having any people appears to be correlated with transit burden, but also doesn't represent
# on the ground need. For now, we remove these tracts from the percentile calculation. (To be QAed live) # on the ground need. For now, we remove these tracts from the percentile calculation.ß
# Similarly, we want to exclude low population tracts from FEMA's index
low_population = 20 low_population = 20
drop_tracts = df_copy[ drop_tracts = df_copy[
df_copy[field_names.TOTAL_POP_FIELD] <= low_population df_copy[field_names.TOTAL_POP_FIELD].fillna(0)
<= low_population
][field_names.GEOID_TRACT_FIELD].to_list() ][field_names.GEOID_TRACT_FIELD].to_list()
logger.info( logger.info(
f"Dropping {len(drop_tracts)} tracts from DOT traffic burden" f"Dropping {len(drop_tracts)} tracts from DOT traffic burden"