diff --git a/data/data-pipeline/data_pipeline/content/config/csv.yml b/data/data-pipeline/data_pipeline/content/config/csv.yml index 6451cbf94..8b754e405 100644 --- a/data/data-pipeline/data_pipeline/content/config/csv.yml +++ b/data/data-pipeline/data_pipeline/content/config/csv.yml @@ -272,3 +272,21 @@ fields: - score_name: Leaky underground storage tanks label: Leaky underground storage tanks format: float + - score_name: Share of properties at risk of flood in 30 years + label: Share of properties at risk of flood in 30 years + format: float + - score_name: Share of properties at risk of fire in 30 years + label: Share of properties at risk of fire in 30 years + format: float + - score_name: Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income? + label: Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income? + format: bool + - score_name: Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income? + label: Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income? + format: bool + - score_name: Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years + label: Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years + format: bool + - score_name: Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years + label: Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years + format: bool \ No newline at end of file diff --git a/data/data-pipeline/data_pipeline/content/config/excel.yml b/data/data-pipeline/data_pipeline/content/config/excel.yml index 94d4f55d8..a9ab57b69 100644 --- a/data/data-pipeline/data_pipeline/content/config/excel.yml +++ b/data/data-pipeline/data_pipeline/content/config/excel.yml @@ -276,3 +276,21 @@ sheets: - score_name: Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education in 2009 (island areas)? label: Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education in 2009 (island areas)? format: bool + - score_name: Share of properties at risk of flood in 30 years + label: Share of properties at risk of flood in 30 years + format: float + - score_name: Share of properties at risk of fire in 30 years + label: Share of properties at risk of fire in 30 years + format: float + - score_name: Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income? + label: Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income? + format: bool + - score_name: Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income? + label: Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income? + format: bool + - score_name: Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years + label: Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years + format: bool + - score_name: Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years + label: Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years + format: bool diff --git a/data/data-pipeline/data_pipeline/etl/constants.py b/data/data-pipeline/data_pipeline/etl/constants.py index 1ac862b8a..5f71af3aa 100644 --- a/data/data-pipeline/data_pipeline/etl/constants.py +++ b/data/data-pipeline/data_pipeline/etl/constants.py @@ -34,6 +34,16 @@ "module_dir": "mapping_for_ej", "class_name": "MappingForEJETL", }, + { + "name": "fsf_flood_risk", + "module_dir": "fsf_flood_risk", + "class_name": "FloodRiskETL", + }, + { + "name": "fsf_wildfire_risk", + "module_dir": "fsf_wildfire_risk", + "class_name": "WildfireRiskETL", + }, { "name": "ejscreen", "module_dir": "ejscreen", diff --git a/data/data-pipeline/data_pipeline/etl/score/config/datasets.yml b/data/data-pipeline/data_pipeline/etl/score/config/datasets.yml index aa09e21d5..be07d6ccb 100644 --- a/data/data-pipeline/data_pipeline/etl/score/config/datasets.yml +++ b/data/data-pipeline/data_pipeline/etl/score/config/datasets.yml @@ -157,6 +157,88 @@ datasets: include_in_tiles: true include_in_downloadable_files: true + - long_name: "First Street Foundation Flood Risk" + short_name: "FSF Flood Risk" + module_name: fsf_flood_risk + input_geoid_tract_field_name: "GEOID" + load_fields: + - short_name: "flood_eligible_properties" + df_field_name: "COUNT_PROPERTIES" + long_name: "Count of properties eligible for flood risk calculation within tract (floor of 250)" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: false + - short_name: "flood_risk_properties_today" + df_field_name: "PROPERTIES_AT_RISK_FROM_FLOODING_TODAY" + long_name: "Count of properties at risk of flood today" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: false + - short_name: "flood_risk_properties_30yrs" + df_field_name: "PROPERTIES_AT_RISK_FROM_FLOODING_IN_30_YEARS" + long_name: "Count of properties at risk of flood in 30 years" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: false + - short_name: "flood_risk_share_today" + df_field_name: "SHARE_OF_PROPERTIES_AT_RISK_FROM_FLOODING_TODAY" + long_name: "Share of properties at risk of flood today" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: true + - short_name: "flood_risk_share_30yrs" + df_field_name: "SHARE_OF_PROPERTIES_AT_RISK_FROM_FLOODING_IN_30_YEARS" + long_name: "Share of properties at risk of flood in 30 years" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: true + + - long_name: "First Street Foundation Wildfire Risk" + short_name: "FSF Wildfire Risk" + module_name: fsf_wildfire_risk + input_geoid_tract_field_name: "GEOID" + load_fields: + - short_name: "fire_eligible_properties" + df_field_name: "COUNT_PROPERTIES" + long_name: "Count of properties eligible for wildfire risk calculation within tract (floor of 250)" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: false + - short_name: "fire_risk_properties_today" + df_field_name: "PROPERTIES_AT_RISK_FROM_FIRE_TODAY" + long_name: "Count of properties at risk of wildfire today" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: false + - short_name: "fire_risk_properties_30yrs" + df_field_name: "PROPERTIES_AT_RISK_FROM_FIRE_IN_30_YEARS" + long_name: "Count of properties at risk of wildfire in 30 years" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: false + - short_name: "fire_risk_share_today" + df_field_name: "SHARE_OF_PROPERTIES_AT_RISK_FROM_FIRE_TODAY" + long_name: "Share of properties at risk of fire today" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: true + - short_name: "fire_risk_share_30yrs" + df_field_name: "SHARE_OF_PROPERTIES_AT_RISK_FROM_FIRE_IN_30_YEARS" + long_name: "Share of properties at risk of fire in 30 years" + field_type: float + include_in_tiles: false + include_in_downloadable_files: true + create_percentile: true + - long_name: "DOT Travel Disadvantage Index" short_name: "DOT" module_name: "travel_composite" diff --git a/data/data-pipeline/data_pipeline/etl/score/constants.py b/data/data-pipeline/data_pipeline/etl/score/constants.py index cf3bee971..07ee7f2c2 100644 --- a/data/data-pipeline/data_pipeline/etl/score/constants.py +++ b/data/data-pipeline/data_pipeline/etl/score/constants.py @@ -293,12 +293,18 @@ field_names.WORKFORCE_THRESHOLD_EXCEEDED: "M_WKFC_EOMI", # These are the booleans for socioeconomic indicators ## this measures low income boolean - field_names.FPL_200_SERIES: "FPL200S", + field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED: "FPL200S", ## Low high school for t&wd field_names.WORKFORCE_SOCIO_INDICATORS_EXCEEDED: "M_WKFC_EBSI", field_names.DOT_BURDEN_PCTILE_THRESHOLD: "TD_ET", field_names.DOT_TRAVEL_BURDEN_FIELD - + field_names.PERCENTILE_FIELD_SUFFIX: "TD_PFS" + + field_names.PERCENTILE_FIELD_SUFFIX: "TD_PFS", + field_names.FUTURE_FLOOD_RISK_FIELD + + field_names.PERCENTILE_FIELD_SUFFIX: "FLD_PFS", + field_names.FUTURE_WILDFIRE_RISK_FIELD + + field_names.PERCENTILE_FIELD_SUFFIX: "WF_PFS", + field_names.HIGH_FUTURE_FLOOD_RISK_FIELD: "FLD_ET", + field_names.HIGH_FUTURE_WILDFIRE_RISK_FIELD: "WF_ET", ## FPL 200 and low higher ed for all others should no longer be M_EBSI, but rather ## FPL_200 (there is no higher ed in narwhal) } @@ -352,4 +358,7 @@ field_names.COLLEGE_NON_ATTENDANCE_FIELD, field_names.COLLEGE_ATTENDANCE_FIELD, field_names.DOT_TRAVEL_BURDEN_FIELD + field_names.PERCENTILE_FIELD_SUFFIX, + field_names.FUTURE_FLOOD_RISK_FIELD + field_names.PERCENTILE_FIELD_SUFFIX, + field_names.FUTURE_WILDFIRE_RISK_FIELD + + field_names.PERCENTILE_FIELD_SUFFIX, ] diff --git a/data/data-pipeline/data_pipeline/etl/score/etl_score.py b/data/data-pipeline/data_pipeline/etl/score/etl_score.py index a2e6e8585..55fe24d4b 100644 --- a/data/data-pipeline/data_pipeline/etl/score/etl_score.py +++ b/data/data-pipeline/data_pipeline/etl/score/etl_score.py @@ -11,6 +11,10 @@ from data_pipeline.etl.sources.dot_travel_composite.etl import ( TravelCompositeETL, ) +from data_pipeline.etl.sources.fsf_flood_risk.etl import ( + FloodRiskETL, +) +from data_pipeline.etl.sources.fsf_wildfire_risk.etl import WildfireRiskETL from data_pipeline.score.score_runner import ScoreRunner from data_pipeline.score import field_names from data_pipeline.etl.score import constants @@ -41,6 +45,8 @@ def __init__(self): self.child_opportunity_index_df: pd.DataFrame self.hrs_df: pd.DataFrame self.dot_travel_disadvantage_df: pd.DataFrame + self.fsf_flood_df: pd.DataFrame + self.fsf_fire_df: pd.DataFrame def extract(self) -> None: logger.info("Loading data sets from disk.") @@ -122,6 +128,12 @@ def extract(self) -> None: # Load DOT Travel Disadvantage self.dot_travel_disadvantage_df = TravelCompositeETL.get_data_frame() + # Load fire risk data + self.fsf_fire_df = WildfireRiskETL.get_data_frame() + + # Load flood risk data + self.fsf_flood_df = FloodRiskETL.get_data_frame() + # Load GeoCorr Urban Rural Map geocorr_urban_rural_csv = ( constants.DATA_PATH / "dataset" / "geocorr" / "usa.csv" @@ -342,6 +354,8 @@ def _prepare_initial_df(self) -> pd.DataFrame: self.child_opportunity_index_df, self.hrs_df, self.dot_travel_disadvantage_df, + self.fsf_flood_df, + self.fsf_fire_df, ] # Sanity check each data frame before merging. @@ -426,6 +440,8 @@ def _prepare_initial_df(self) -> pd.DataFrame: field_names.UST_FIELD, field_names.DOT_TRAVEL_BURDEN_FIELD, field_names.AGRICULTURAL_VALUE_BOOL_FIELD, + field_names.FUTURE_FLOOD_RISK_FIELD, + field_names.FUTURE_WILDFIRE_RISK_FIELD, field_names.POVERTY_LESS_THAN_200_FPL_IMPUTED_FIELD, ] diff --git a/data/data-pipeline/data_pipeline/etl/score/tests/sample_data/score_data_initial.csv b/data/data-pipeline/data_pipeline/etl/score/tests/sample_data/score_data_initial.csv index f7b0ebd50..d878573f1 100644 --- a/data/data-pipeline/data_pipeline/etl/score/tests/sample_data/score_data_initial.csv +++ b/data/data-pipeline/data_pipeline/etl/score/tests/sample_data/score_data_initial.csv @@ -1,3 +1,3 @@ -GEOID10_TRACT,Persistent Poverty Census Tract,Tract-level redlining score meets or exceeds 3.25,Housing burden (percent),Share of homes with no kitchen or indoor plumbing (percent),Total population,Median household income (% of state median household income),Current asthma among adults aged greater than or equal to 18 years,Coronary heart disease among adults aged greater than or equal to 18 years,Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years,Current lack of health insurance among adults aged 18-64 years,Diagnosed diabetes among adults aged greater than or equal to 18 years,Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years,Percent of individuals < 100% Federal Poverty Line,Percent of individuals < 150% Federal Poverty Line,Percent of individuals below 200% Federal Poverty Line,Area Median Income (State or metropolitan),Median household income in the past 12 months,Energy burden,FEMA Risk Index Expected Annual Loss Score,Urban Heuristic Flag,Air toxics cancer risk,Respiratory hazard index,Diesel particulate matter exposure,PM2.5 in the air,Ozone,Traffic proximity and volume,Proximity to Risk Management Plan (RMP) facilities,Proximity to hazardous waste sites,Proximity to NPL sites,Wastewater discharge,Percent pre-1960s housing (lead paint indicator),Individuals under 5 years old,Individuals over 64 years old,Linguistic isolation (percent),Percent of households in linguistic isolation,Poverty (Less than 200% of federal poverty line),Percent individuals age 25 or over with less than high school degree,Unemployment (percent),Median value ($) of owner-occupied housing units,Percent enrollment in college or graduate school,Percent of population not currently enrolled in college or graduate school,Expected building loss rate (Natural Hazards Risk Index),Expected agricultural loss rate (Natural Hazards Risk Index),Expected population loss rate (Natural Hazards Risk Index),Percent individuals age 25 or over with less than high school degree in 2009,Percentage households below 100% of federal poverty line in 2009,Unemployment (percent) in 2009,Unemployment (percent) in 2010,Percent of individuals less than 100% Federal Poverty Line in 2010,Total population in 2009,Summer days above 90F,Percent low access to healthy food,Percent impenetrable surface areas,Leaky underground storage tanks,DOT Travel Barriers Score,Contains agricultural value,"Percent of individuals below 200% Federal Poverty Line, imputed and adjusted",Third grade reading proficiency,Median household income as a percent of area median income,Life expectancy (years),Median household income as a percent of territory median income in 2009,Housing burden (percent) (percentile),Share of homes with no kitchen or indoor plumbing (percent) (percentile),Total population (percentile),Median household income (% of state median household income) (percentile),Current asthma among adults aged greater than or equal to 18 years (percentile),Coronary heart disease among adults aged greater than or equal to 18 years (percentile),Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years (percentile),Current lack of health insurance among adults aged 18-64 years (percentile),Diagnosed diabetes among adults aged greater than or equal to 18 years (percentile),Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years (percentile),Percent of individuals < 100% Federal Poverty Line (percentile),Percent of individuals < 150% Federal Poverty Line (percentile),Percent of individuals below 200% Federal Poverty Line (percentile),Area Median Income (State or metropolitan) (percentile),Median household income in the past 12 months (percentile),Energy burden (percentile),FEMA Risk Index Expected Annual Loss Score (percentile),Urban Heuristic Flag (percentile),Air toxics cancer risk (percentile),Respiratory hazard index (percentile),Diesel particulate matter exposure (percentile),PM2.5 in the air (percentile),Ozone (percentile),Traffic proximity and volume (percentile),Proximity to Risk Management Plan (RMP) facilities (percentile),Proximity to hazardous waste sites (percentile),Proximity to NPL sites (percentile),Wastewater discharge (percentile),Percent pre-1960s housing (lead paint indicator) (percentile),Individuals under 5 years old (percentile),Individuals over 64 years old (percentile),Linguistic isolation (percent) (percentile),Percent of households in linguistic isolation (percentile),Poverty (Less than 200% of federal poverty line) (percentile),Percent individuals age 25 or over with less than high school degree (percentile),Unemployment (percent) (percentile),Median value ($) of owner-occupied housing units (percentile),Percent enrollment in college or graduate school (percentile),Percent of population not currently enrolled in college or graduate school (percentile),Expected building loss rate (Natural Hazards Risk Index) (percentile),Expected agricultural loss rate (Natural Hazards Risk Index) (percentile),Expected population loss rate (Natural Hazards Risk Index) (percentile),Percent individuals age 25 or over with less than high school degree in 2009 (percentile),Percentage households below 100% of federal poverty line in 2009 (percentile),Unemployment (percent) in 2009 (percentile),Unemployment (percent) in 2010 (percentile),Percent of individuals less than 100% Federal Poverty Line in 2010 (percentile),Total population in 2009 (percentile),Summer days above 90F (percentile),Percent low access to healthy food (percentile),Percent impenetrable surface areas (percentile),Leaky underground storage tanks (percentile),DOT Travel Barriers Score (percentile),Contains agricultural value (percentile),"Percent of individuals below 200% Federal Poverty Line, imputed and adjusted (percentile)",Low third grade reading proficiency (percentile),Low median household income as a percent of area median income (percentile),Low life expectancy (percentile),Low median household income as a percent of territory median income in 2009 (percentile),Total population in 2009 (island areas) and 2019 (states and PR),Score A,Score B,Socioeconomic Factors,Sensitive populations,Environmental effects,Exposures,Pollution Burden,Population Characteristics,Score C,"Low AMI, Low HS graduation",Meets socioeconomic criteria,Meets burden criteria,Score F (communities),Score G (communities),Score G,Score G (percentile),Score H (communities),Score H,Score I (communities),Score I,Score I (percentile),NMTC (communities),Score K (communities),Total threshold criteria exceeded,Is low income?,Greater than or equal to the 90th percentile for expected population loss rate and is low income?,Greater than or equal to the 90th percentile for expected agriculture loss rate and is low income?,Greater than or equal to the 90th percentile for expected building loss rate and is low income?,Climate Factor (Definition L),Greater than or equal to the 90th percentile for PM2.5 exposure and is low income?,Greater than or equal to the 90th percentile for energy burden and is low income?,Energy Factor (Definition L),Greater than or equal to the 90th percentile for diesel particulate matter and is low income?,Greater than or equal to the 90th percentile for traffic proximity and is low income?,Transportation Factor (Definition L),Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile and is low income?,Greater than or equal to the 90th percentile for housing burden and is low income?,Housing Factor (Definition L),Greater than or equal to the 90th percentile for proximity to RMP sites and is low income?,Greater than or equal to the 90th percentile for proximity to superfund sites and is low income?,Greater than or equal to the 90th percentile for proximity to hazardous waste facilities and is low income?,Pollution Factor (Definition L),Greater than or equal to the 90th percentile for wastewater discharge and is low income?,Water Factor (Definition L),Greater than or equal to the 90th percentile for diabetes and is low income?,Greater than or equal to the 90th percentile for asthma and is low income?,Greater than or equal to the 90th percentile for heart disease and is low income?,Greater than or equal to the 90th percentile for low life expectancy and is low income?,Health Factor (Definition L),Low high school education,Greater than or equal to the 90th percentile for households in linguistic isolation and has low HS education?,Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS education?,Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education?,Greater than or equal to the 90th percentile for unemployment and has low HS education?,Unemployment (percent) in 2009 (island areas) and 2010 (states and PR),Unemployment (percent) in 2009 exceeds 90th percentile,Percentage households below 100% of federal poverty line in 2009 (island areas) and 2010 (states and PR),Percentage households below 100% of federal poverty line in 2009 exceeds 90th percentile,Low median household income as a percent of territory median income in 2009 exceeds 90th percentile,Low high school education in 2009 (island areas),Greater than or equal to the 90th percentile for unemployment and has low HS education in 2009 (island areas)?,Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS education in 2009 (island areas)?,Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education in 2009 (island areas)?,Workforce Factor (Definition L),Definition L (communities),Any Non-Workforce Factor (Definition L),Definition L (percentile),Exceeds FPL200 threshold,Percent higher ed enrollment rate is less than 20%,Is low income and has a low percent of higher ed students?,Greater than or equal to the 90th percentile for expected population loss,Greater than or equal to the 90th percentile for expected agricultural loss,Greater than or equal to the 90th percentile for expected building loss,At least one climate threshold exceeded,"Greater than or equal to the 90th percentile for expected population loss rate, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for expected agriculture loss rate, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for expected building loss rate, is low income, and has a low percent of higher ed students?",Climate Factor (Definition M),Greater than or equal to the 90th percentile for energy burden,Greater than or equal to the 90th percentile for pm2.5 exposure,At least one energy threshold exceeded,"Greater than or equal to the 90th percentile for PM2.5 exposure, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for energy burden, is low income, and has a low percent of higher ed students?",Energy Factor (Definition M),Greater than or equal to the 90th percentile for diesel particulate matter,Greater than or equal to the 90th percentile for traffic proximity,At least one traffic threshold exceeded,"Greater than or equal to the 90th percentile for diesel particulate matter, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for traffic proximity, is low income, and has a low percent of higher ed students?",Transportation Factor (Definition M),Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile,Greater than or equal to the 90th percentile for housing burden,At least one housing threshold exceeded,"Greater than or equal to the 90th percentile for lead paint, the median house value is less than 90th percentile, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for housing burden, is low income, and has a low percent of higher ed students?",Housing Factor (Definition M),Greater than or equal to the 90th percentile for RMP proximity,Greater than or equal to the 90th percentile for NPL (superfund sites) proximity,Greater than or equal to the 90th percentile for proximity to hazardous waste sites,At least one pollution threshold exceeded,"Greater than or equal to the 90th percentile for proximity to RMP sites, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for proximity to superfund sites, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for proximity to hazardous waste facilities, is low income, and has a low percent of higher ed students?",Pollution Factor (Definition M),Greater than or equal to the 90th percentile for wastewater discharge,At least one water threshold exceeded,"Greater than or equal to the 90th percentile for wastewater discharge, is low income, and has a low percent of higher ed students?",Water Factor (Definition M),Greater than or equal to the 90th percentile for diabetes,Greater than or equal to the 90th percentile for asthma,Greater than or equal to the 90th percentile for heart disease,Greater than or equal to the 90th percentile for low life expectancy,At least one health threshold exceeded,"Greater than or equal to the 90th percentile for diabetes, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for asthma, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for heart disease, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for low life expectancy, is low income, and has a low percent of higher ed students?",Health Factor (Definition M),Low high school education and low percent of higher ed students,Greater than or equal to the 90th percentile for unemployment,Greater than or equal to the 90th percentile for low median household income as a percent of area median income,Greater than or equal to the 90th percentile for households in linguistic isolation,Greater than or equal to the 90th percentile for households at or below 100% federal poverty level,"Greater than or equal to the 90th percentile for households in linguistic isolation, has low HS attainment, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for households at or below 100% federal poverty level, has low HS attainment, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for low median household income as a percent of area median income, has low HS attainment, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for unemployment, has low HS attainment, and has a low percent of higher ed students?",Unemployment (percent) in 2009 for island areas (percentile),Percentage households below 100% of federal poverty line in 2009 for island areas (percentile),At least one workforce threshold exceeded,Both workforce socioeconomic indicators exceeded,Workforce Factor (Definition M),Total categories exceeded,Definition M (communities),Any Non-Workforce Factor (Definition M),Definition M (percentile),Is low income (imputed and adjusted)?,Climate Factor (Definition N),Energy Factor (Definition N),Greater than or equal to the 90th percentile for DOT travel barriers,Greater than or equal to the 90th percentile for DOT transit barriers and is low income?,Transportation Factor (Definition N),Tract-level redlining score meets or exceeds 3.25 and is low income,Greater than or equal to the 90th percentile for share of homes without indoor plumbing or a kitchen,Greater than or equal to the 90th percentile for share of homes with no kitchen or indoor plumbing and is low income?,Housing Factor (Definition N),Pollution Factor (Definition N),Greater than or equal to the 90th percentile for leaky underwater storage tanks,Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?,Water Factor (Definition N),Health Factor (Definition N),Workforce Factor (Definition N),Definition N (communities),Definition N (communities) (percentile) -01073001100,True,True,0.2752043596730245,0.0,4781.0,0.7327449738800064,11.2,7.2,6.7,16.6,19.3,15.1,0.150375939849624,0.318796992481203,0.3744360902255639,57447.0,37030.0,0.049,18.7674524286,1.0,40.0,0.5,0.467489734286576,9.8735797260274,43.056760130719,181.621925132718,2.0427358988323,0.702342755246247,0.134193041307899,4.45238981883771,0.168806466951973,0.035557414766785,0.203932231750679,0.0,0.0,0.374436090225563,0.0821917808219178,0.0092071611253196,85500.0,0.0890751899397432,0.9109248100602568,0.0004047858,5.6328e-05,2.8039e-06,,,,0.1536983669548511,0.3189099613330878,,62.666668,0.068036923,0.171,1.96440511031451,47.695227725,1.0,0.2853609002858206,58.143433,0.6445941476491375,70.3,,0.6466760729305078,0.2159833426939357,0.6290185267766651,0.2601978513507951,0.8509696039125366,0.7264920810941454,0.4789587420739856,0.6191105803406409,0.965388552418323,0.697012994398476,0.6204255784694491,0.7319894972922707,0.6305043487774192,0.3145069836211475,0.1524256393370651,0.864954517474865,0.6038301323911519,0.5972204988211937,0.9070825388177608,0.8818509942794879,0.8407790792699537,0.8257128232087766,0.5755156814188676,0.3920895082932574,0.9007580978635424,0.4820205132363076,0.7531654977635437,0.9619599422457518,0.3979135417088958,0.1737408953933055,0.7659355954649262,0.1287706711725437,0.13169416629505,0.6347481790786611,0.4189065592792301,0.029797296373751,0.1130218397675614,0.7459773722926589,0.2540362752992234,0.7846412062513758,0.2153147384849333,0.6143028498159407,,,,0.9349594607528132,0.8950599559730369,,0.7537922665342821,0.8019598155467721,0.4126953421856217,0.521114579532709,0.4517484245644384,0.6564635202573585,0.607629501459933,0.990724418702258,0.8218135517196475,0.97046998263836,,4781.0,0.5268273691789456,0.2659001757065985,0.37236445479144,0.3561490540102585,0.6991635185636083,0.7371717708813507,0.7245023534421032,0.3642567544008492,0.2639048758205974,False,False,True,False,True,1,1,True,1,True,1,1,True,True,0,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,0.1536983669548511,False,0.3189099613330878,False,False,False,False,False,False,False,False,False,0,False,True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,True,False,False,True,False,False,False,False,True,False,False,False,True,False,False,True,True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,,,False,False,False,0.0,False,False,0,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,0 -01073001400,True,True,0.1823529411764705,0.0047058823529411,1946.0,0.7136694633528574,11.1,9.1,7.3,21.4,22.4,17.4,0.2816032887975334,0.3679342240493319,0.4835560123329907,57447.0,36066.0,0.07,17.3011023381,1.0,40.0,0.6,0.655319095139786,9.945103013698628,43.1266823529412,3260.33374354854,1.81915896353987,3.34035680534013,0.214095348702766,0.103297800913177,0.647212543554006,0.054984583761562,0.189105858170606,0.0245098039215686,0.024509803921569,0.48355601233299,0.1742543171114599,0.1150121065375302,67800.0,0.0771549125979505,0.9228450874020494,0.0008951111,5.1282e-06,2.3791e-06,,,,0.0804953560371517,0.2950894905920146,,61.666668,0.087159691,0.34900002,3.16184976454882,44.7571359825,1.0,0.4064010997350401,93.77919,0.6278134628440127,71.0,,0.3421186011150532,0.5051574635963891,0.0916001135119795,0.240302951305517,0.8385794307486707,0.9217563763541756,0.6048579715089994,0.7894025988796952,0.9878088657624612,0.8447283118655634,0.8689486351950112,0.8013648049887862,0.7892483999781194,0.3145069836211475,0.1404620788058391,0.970802270706518,0.5282998116553705,0.5972204988211937,0.9070825388177608,0.9704848815036776,0.9380686461454644,0.8391046304110233,0.5827649654828936,0.9563394697362702,0.8799745949379062,0.800259455953298,0.8653801975648978,0.8431750027766466,0.8462723476709774,0.471128768530155,0.6930041485925866,0.5867081244286861,0.5847015580870529,0.7916514641694031,0.7516347007030237,0.9067399297439892,0.0522639122516786,0.6434566620719774,0.356556985519905,0.9166162227602904,0.0865380767537716,0.558933421571466,,,,0.6917513228236646,0.8737301229199994,,0.7501654807214959,0.8647617479139218,0.6268497920495212,0.6418426778016514,0.3716517703914219,0.6564635202573585,0.7883908294582027,0.9537899773356836,0.8364273002184828,0.959938777375042,,1946.0,0.7716430824362135,0.5950327113320798,0.6753692507637045,0.5836136805171427,0.8470123197807451,0.8656408553495148,0.8594313434932582,0.6294914656404236,0.5410046960328895,False,True,True,True,True,1,1,True,1,True,1,1,True,True,9,True,False,False,True,True,False,True,True,True,True,True,False,False,False,False,False,False,False,False,False,True,False,True,True,True,True,False,False,False,True,0.0804953560371517,False,0.2950894905920146,False,False,False,False,False,False,True,True,True,1,True,True,True,False,False,True,True,False,False,True,True,True,False,True,False,True,True,True,True,True,True,True,True,False,False,True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,True,False,True,True,True,True,False,True,True,True,True,True,False,False,False,False,False,False,True,,,True,True,True,6.0,True,True,1,True,True,True,False,False,True,True,False,False,True,False,False,False,False,True,True,True,1 +GEOID10_TRACT,Persistent Poverty Census Tract,Tract-level redlining score meets or exceeds 3.25,Housing burden (percent),Share of homes with no kitchen or indoor plumbing (percent),Total population,Median household income (% of state median household income),Current asthma among adults aged greater than or equal to 18 years,Coronary heart disease among adults aged greater than or equal to 18 years,Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years,Current lack of health insurance among adults aged 18-64 years,Diagnosed diabetes among adults aged greater than or equal to 18 years,Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years,Percent of individuals < 100% Federal Poverty Line,Percent of individuals < 150% Federal Poverty Line,Percent of individuals below 200% Federal Poverty Line,Area Median Income (State or metropolitan),Median household income in the past 12 months,Energy burden,FEMA Risk Index Expected Annual Loss Score,Urban Heuristic Flag,Air toxics cancer risk,Respiratory hazard index,Diesel particulate matter exposure,PM2.5 in the air,Ozone,Traffic proximity and volume,Proximity to Risk Management Plan (RMP) facilities,Proximity to hazardous waste sites,Proximity to NPL sites,Wastewater discharge,Percent pre-1960s housing (lead paint indicator),Individuals under 5 years old,Individuals over 64 years old,Linguistic isolation (percent),Percent of households in linguistic isolation,Poverty (Less than 200% of federal poverty line),Percent individuals age 25 or over with less than high school degree,Unemployment (percent),Median value ($) of owner-occupied housing units,Percent enrollment in college or graduate school,Percent of population not currently enrolled in college or graduate school,Expected building loss rate (Natural Hazards Risk Index),Expected agricultural loss rate (Natural Hazards Risk Index),Expected population loss rate (Natural Hazards Risk Index),Percent individuals age 25 or over with less than high school degree in 2009,Percentage households below 100% of federal poverty line in 2009,Unemployment (percent) in 2009,Unemployment (percent) in 2010,Percent of individuals less than 100% Federal Poverty Line in 2010,Total population in 2009,Summer days above 90F,Percent low access to healthy food,Percent impenetrable surface areas,Leaky underground storage tanks,DOT Travel Barriers Score,Contains agricultural value,Share of properties at risk of flood in 30 years,Share of properties at risk of fire in 30 years,"Percent of individuals below 200% Federal Poverty Line, imputed and adjusted",Third grade reading proficiency,Median household income as a percent of area median income,Life expectancy (years),Median household income as a percent of territory median income in 2009,Housing burden (percent) (percentile),Share of homes with no kitchen or indoor plumbing (percent) (percentile),Total population (percentile),Median household income (% of state median household income) (percentile),Current asthma among adults aged greater than or equal to 18 years (percentile),Coronary heart disease among adults aged greater than or equal to 18 years (percentile),Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years (percentile),Current lack of health insurance among adults aged 18-64 years (percentile),Diagnosed diabetes among adults aged greater than or equal to 18 years (percentile),Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years (percentile),Percent of individuals < 100% Federal Poverty Line (percentile),Percent of individuals < 150% Federal Poverty Line (percentile),Percent of individuals below 200% Federal Poverty Line (percentile),Area Median Income (State or metropolitan) (percentile),Median household income in the past 12 months (percentile),Energy burden (percentile),FEMA Risk Index Expected Annual Loss Score (percentile),Urban Heuristic Flag (percentile),Air toxics cancer risk (percentile),Respiratory hazard index (percentile),Diesel particulate matter exposure (percentile),PM2.5 in the air (percentile),Ozone (percentile),Traffic proximity and volume (percentile),Proximity to Risk Management Plan (RMP) facilities (percentile),Proximity to hazardous waste sites (percentile),Proximity to NPL sites (percentile),Wastewater discharge (percentile),Percent pre-1960s housing (lead paint indicator) (percentile),Individuals under 5 years old (percentile),Individuals over 64 years old (percentile),Linguistic isolation (percent) (percentile),Percent of households in linguistic isolation (percentile),Poverty (Less than 200% of federal poverty line) (percentile),Percent individuals age 25 or over with less than high school degree (percentile),Unemployment (percent) (percentile),Median value ($) of owner-occupied housing units (percentile),Percent enrollment in college or graduate school (percentile),Percent of population not currently enrolled in college or graduate school (percentile),Expected building loss rate (Natural Hazards Risk Index) (percentile),Expected agricultural loss rate (Natural Hazards Risk Index) (percentile),Expected population loss rate (Natural Hazards Risk Index) (percentile),Percent individuals age 25 or over with less than high school degree in 2009 (percentile),Percentage households below 100% of federal poverty line in 2009 (percentile),Unemployment (percent) in 2009 (percentile),Unemployment (percent) in 2010 (percentile),Percent of individuals less than 100% Federal Poverty Line in 2010 (percentile),Total population in 2009 (percentile),Summer days above 90F (percentile),Percent low access to healthy food (percentile),Percent impenetrable surface areas (percentile),Leaky underground storage tanks (percentile),DOT Travel Barriers Score (percentile),Contains agricultural value (percentile),Share of properties at risk of flood in 30 years (percentile),Share of properties at risk of fire in 30 years (percentile),"Percent of individuals below 200% Federal Poverty Line, imputed and adjusted (percentile)",Low third grade reading proficiency (percentile),Low median household income as a percent of area median income (percentile),Low life expectancy (percentile),Low median household income as a percent of territory median income in 2009 (percentile),Total population in 2009 (island areas) and 2019 (states and PR),Total threshold criteria exceeded,Exceeds FPL200 threshold,Percent higher ed enrollment rate is less than 20%,Is low income and has a low percent of higher ed students?,Greater than or equal to the 90th percentile for expected population loss,Greater than or equal to the 90th percentile for expected agricultural loss,Greater than or equal to the 90th percentile for expected building loss,At least one climate threshold exceeded,"Greater than or equal to the 90th percentile for expected population loss rate, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for expected agriculture loss rate, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for expected building loss rate, is low income, and has a low percent of higher ed students?",Climate Factor (Definition M),Greater than or equal to the 90th percentile for energy burden,Greater than or equal to the 90th percentile for pm2.5 exposure,At least one energy threshold exceeded,"Greater than or equal to the 90th percentile for PM2.5 exposure, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for energy burden, is low income, and has a low percent of higher ed students?",Energy Factor (Definition M),Greater than or equal to the 90th percentile for diesel particulate matter,Greater than or equal to the 90th percentile for traffic proximity,At least one traffic threshold exceeded,"Greater than or equal to the 90th percentile for diesel particulate matter, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for traffic proximity, is low income, and has a low percent of higher ed students?",Transportation Factor (Definition M),Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile,Greater than or equal to the 90th percentile for housing burden,At least one housing threshold exceeded,"Greater than or equal to the 90th percentile for lead paint, the median house value is less than 90th percentile, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for housing burden, is low income, and has a low percent of higher ed students?",Housing Factor (Definition M),Greater than or equal to the 90th percentile for RMP proximity,Greater than or equal to the 90th percentile for NPL (superfund sites) proximity,Greater than or equal to the 90th percentile for proximity to hazardous waste sites,At least one pollution threshold exceeded,"Greater than or equal to the 90th percentile for proximity to RMP sites, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for proximity to superfund sites, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for proximity to hazardous waste facilities, is low income, and has a low percent of higher ed students?",Pollution Factor (Definition M),Greater than or equal to the 90th percentile for wastewater discharge,At least one water threshold exceeded,"Greater than or equal to the 90th percentile for wastewater discharge, is low income, and has a low percent of higher ed students?",Water Factor (Definition M),Greater than or equal to the 90th percentile for diabetes,Greater than or equal to the 90th percentile for asthma,Greater than or equal to the 90th percentile for heart disease,Greater than or equal to the 90th percentile for low life expectancy,At least one health threshold exceeded,"Greater than or equal to the 90th percentile for diabetes, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for asthma, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for heart disease, is low income, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for low life expectancy, is low income, and has a low percent of higher ed students?",Health Factor (Definition M),Low high school education and low percent of higher ed students,Greater than or equal to the 90th percentile for unemployment,Greater than or equal to the 90th percentile for low median household income as a percent of area median income,Greater than or equal to the 90th percentile for households in linguistic isolation,Greater than or equal to the 90th percentile for households at or below 100% federal poverty level,"Greater than or equal to the 90th percentile for households in linguistic isolation, has low HS attainment, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for households at or below 100% federal poverty level, has low HS attainment, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for low median household income as a percent of area median income, has low HS attainment, and has a low percent of higher ed students?","Greater than or equal to the 90th percentile for unemployment, has low HS attainment, and has a low percent of higher ed students?",Unemployment (percent) in 2009 (island areas) and 2010 (states and PR),Unemployment (percent) in 2009 for island areas (percentile),Unemployment (percent) in 2009 exceeds 90th percentile,Percentage households below 100% of federal poverty line in 2009 (island areas) and 2010 (states and PR),Percentage households below 100% of federal poverty line in 2009 for island areas (percentile),Percentage households below 100% of federal poverty line in 2009 exceeds 90th percentile,Low median household income as a percent of territory median income in 2009 exceeds 90th percentile,Low high school education in 2009 (island areas),Greater than or equal to the 90th percentile for unemployment and has low HS education in 2009 (island areas)?,Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS education in 2009 (island areas)?,Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education in 2009 (island areas)?,At least one workforce threshold exceeded,Both workforce socioeconomic indicators exceeded,Workforce Factor (Definition M),Total categories exceeded,Definition M (communities),Any Non-Workforce Factor (Definition M),Definition M (percentile),Is low income (imputed and adjusted)?,Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years,Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years,Greater than or equal to the 90th percentile for expected population loss rate and is low income?,Greater than or equal to the 90th percentile for expected agriculture loss rate and is low income?,Greater than or equal to the 90th percentile for expected building loss rate and is low income?,Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income?,Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income?,Climate Factor (Definition N),Greater than or equal to the 90th percentile for PM2.5 exposure and is low income?,Greater than or equal to the 90th percentile for energy burden and is low income?,Energy Factor (Definition N),Greater than or equal to the 90th percentile for DOT travel barriers,Greater than or equal to the 90th percentile for diesel particulate matter and is low income?,Greater than or equal to the 90th percentile for traffic proximity and is low income?,Greater than or equal to the 90th percentile for DOT transit barriers and is low income?,Transportation Factor (Definition N),Tract-level redlining score meets or exceeds 3.25 and is low income,Greater than or equal to the 90th percentile for share of homes without indoor plumbing or a kitchen,Greater than or equal to the 90th percentile for share of homes with no kitchen or indoor plumbing and is low income?,Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile and is low income?,Greater than or equal to the 90th percentile for housing burden and is low income?,Housing Factor (Definition N),Greater than or equal to the 90th percentile for proximity to RMP sites and is low income?,Greater than or equal to the 90th percentile for proximity to superfund sites and is low income?,Greater than or equal to the 90th percentile for proximity to hazardous waste facilities and is low income?,Pollution Factor (Definition N),Greater than or equal to the 90th percentile for leaky underwater storage tanks,Greater than or equal to the 90th percentile for wastewater discharge and is low income?,Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?,Water Factor (Definition N),Greater than or equal to the 90th percentile for diabetes and is low income?,Greater than or equal to the 90th percentile for asthma and is low income?,Greater than or equal to the 90th percentile for heart disease and is low income?,Greater than or equal to the 90th percentile for low life expectancy and is low income?,Health Factor (Definition N),Low high school education,Greater than or equal to the 90th percentile for households in linguistic isolation and has low HS education?,Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS education?,Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education?,Greater than or equal to the 90th percentile for unemployment and has low HS education?,Workforce Factor (Definition N),Definition N (communities),Definition N (communities) (percentile) +01073001100,True,True,0.2752043596730245,0.0,4781.0,0.7327449738800064,11.2,7.2,6.7,16.6,19.3,15.1,0.150375939849624,0.318796992481203,0.3744360902255639,57447.0,37030.0,0.049,18.7674524286,1.0,40.0,0.5,0.467489734286576,9.8735797260274,43.056760130719,181.621925132718,2.0427358988323,0.702342755246247,0.134193041307899,4.45238981883771,0.168806466951973,0.035557414766785,0.203932231750679,0.0,0.0,0.374436090225563,0.0821917808219178,0.0092071611253196,85500.0,0.0890751899397432,0.9109248100602568,0.0004047858,5.6328e-05,2.8039e-06,,,,0.1536983669548511,0.3189099613330878,,62.666668,0.068036923,0.171,1.96440511031451,47.695227725,1.0,0.0754274220583305,0.6620851491786792,0.2853609002858206,58.143433,0.6445941476491375,70.3,,0.6466760729305078,0.2159833426939357,0.6290185267766651,0.2601978513507951,0.8509696039125366,0.7264920810941454,0.4789587420739856,0.6191105803406409,0.965388552418323,0.697012994398476,0.6204255784694491,0.7319894972922707,0.6305043487774192,0.3145069836211475,0.1524256393370651,0.864954517474865,0.6038301323911519,0.5972204988211937,0.9070825388177608,0.8818509942794879,0.8407790792699537,0.8257128232087766,0.5755156814188676,0.3920895082932574,0.9007580978635424,0.4820205132363076,0.7531654977635437,0.9619599422457518,0.3979135417088958,0.1737408953933055,0.7659355954649262,0.1287706711725437,0.13169416629505,0.6347481790786611,0.4189065592792301,0.029797296373751,0.1130218397675614,0.7459773722926589,0.2540362752992234,0.7846412062513758,0.2153147384849333,0.6143028498159407,,,,0.9349594607528132,0.8950599559730369,,0.7537922665342821,0.8019598155467721,0.4126953421856217,0.521114579532709,0.4517484245644384,0.6564635202573585,0.4977059209088922,0.8410893082809093,0.607629501459933,0.990724418702258,0.8218135517196475,0.97046998263836,,4781.0,0,False,True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,True,False,False,True,False,False,False,False,True,False,False,False,True,False,False,True,True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,0.1536983669548511,,False,0.3189099613330878,,False,False,False,False,False,False,False,False,False,0.0,False,False,0,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,0 +01073001400,True,True,0.1823529411764705,0.0047058823529411,1946.0,0.7136694633528574,11.1,9.1,7.3,21.4,22.4,17.4,0.2816032887975334,0.3679342240493319,0.4835560123329907,57447.0,36066.0,0.07,17.3011023381,1.0,40.0,0.6,0.655319095139786,9.945103013698628,43.1266823529412,3260.33374354854,1.81915896353987,3.34035680534013,0.214095348702766,0.103297800913177,0.647212543554006,0.054984583761562,0.189105858170606,0.0245098039215686,0.024509803921569,0.48355601233299,0.1742543171114599,0.1150121065375302,67800.0,0.0771549125979505,0.9228450874020494,0.0008951111,5.1282e-06,2.3791e-06,,,,0.0804953560371517,0.2950894905920146,,61.666668,0.087159691,0.34900002,3.16184976454882,44.7571359825,1.0,0.2384615384615384,0.0,0.4064010997350401,93.77919,0.6278134628440127,71.0,,0.3421186011150532,0.5051574635963891,0.0916001135119795,0.240302951305517,0.8385794307486707,0.9217563763541756,0.6048579715089994,0.7894025988796952,0.9878088657624612,0.8447283118655634,0.8689486351950112,0.8013648049887862,0.7892483999781194,0.3145069836211475,0.1404620788058391,0.970802270706518,0.5282998116553705,0.5972204988211937,0.9070825388177608,0.9704848815036776,0.9380686461454644,0.8391046304110233,0.5827649654828936,0.9563394697362702,0.8799745949379062,0.800259455953298,0.8653801975648978,0.8431750027766466,0.8462723476709774,0.471128768530155,0.6930041485925866,0.5867081244286861,0.5847015580870529,0.7916514641694031,0.7516347007030237,0.9067399297439892,0.0522639122516786,0.6434566620719774,0.356556985519905,0.9166162227602904,0.0865380767537716,0.558933421571466,,,,0.6917513228236646,0.8737301229199994,,0.7501654807214959,0.8647617479139218,0.6268497920495212,0.6418426778016514,0.3716517703914219,0.6564635202573585,0.8849410093948001,0.3366245885930925,0.7883908294582027,0.9537899773356836,0.8364273002184828,0.959938777375042,,1946.0,9,True,True,True,False,False,True,True,False,False,True,True,True,False,True,False,True,True,True,True,True,True,True,True,False,False,True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,True,False,True,True,True,True,False,True,True,True,True,True,False,False,False,False,False,False,True,0.0804953560371517,,False,0.2950894905920146,,False,False,False,False,False,False,True,True,True,6.0,True,True,1,True,False,False,False,False,True,False,False,True,False,True,True,False,True,True,False,True,True,False,False,False,False,True,False,False,False,False,False,False,False,False,True,False,True,True,True,True,False,False,False,True,True,True,1 diff --git a/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/downloadable_data_expected.pkl b/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/downloadable_data_expected.pkl index c7b18cd75..3febf24a1 100644 Binary files a/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/downloadable_data_expected.pkl and b/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/downloadable_data_expected.pkl differ diff --git a/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/score_data_expected.pkl b/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/score_data_expected.pkl index 2700c78b5..e53e516c7 100644 Binary files a/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/score_data_expected.pkl and b/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/score_data_expected.pkl differ diff --git a/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/score_transformed_expected.pkl b/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/score_transformed_expected.pkl index d86f18db0..0895c955e 100644 Binary files a/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/score_transformed_expected.pkl and b/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/score_transformed_expected.pkl differ diff --git a/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/tile_data_expected.pkl b/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/tile_data_expected.pkl index 742ef748e..e8cd7aa7c 100644 Binary files a/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/tile_data_expected.pkl and b/data/data-pipeline/data_pipeline/etl/score/tests/snapshots/tile_data_expected.pkl differ diff --git a/data/data-pipeline/data_pipeline/etl/sources/fsf_flood_risk/README.md b/data/data-pipeline/data_pipeline/etl/sources/fsf_flood_risk/README.md new file mode 100644 index 000000000..7b4def2b3 --- /dev/null +++ b/data/data-pipeline/data_pipeline/etl/sources/fsf_flood_risk/README.md @@ -0,0 +1,3 @@ +# FSF flood risk data + +Flood risk computed as 1 in 100 year flood zone \ No newline at end of file diff --git a/data/data-pipeline/data_pipeline/etl/sources/fsf_flood_risk/__init__.py b/data/data-pipeline/data_pipeline/etl/sources/fsf_flood_risk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/data/data-pipeline/data_pipeline/etl/sources/fsf_flood_risk/etl.py b/data/data-pipeline/data_pipeline/etl/sources/fsf_flood_risk/etl.py new file mode 100644 index 000000000..78a4aefa9 --- /dev/null +++ b/data/data-pipeline/data_pipeline/etl/sources/fsf_flood_risk/etl.py @@ -0,0 +1,93 @@ +# pylint: disable=unsubscriptable-object +# pylint: disable=unsupported-assignment-operation + +import pandas as pd +from data_pipeline.config import settings + +from data_pipeline.etl.base import ExtractTransformLoad, ValidGeoLevel +from data_pipeline.utils import get_module_logger + +logger = get_module_logger(__name__) + + +class FloodRiskETL(ExtractTransformLoad): + """ETL class for the First Street Foundation flood risk dataset""" + + NAME = "fsf_flood_risk" + SOURCE_URL = settings.AWS_JUSTICE40_DATASOURCES_URL + "/fsf_flood.zip" + GEO_LEVEL = ValidGeoLevel.CENSUS_TRACT + + # Output score variables (values set on datasets.yml) for linting purposes + COUNT_PROPERTIES: str + PROPERTIES_AT_RISK_FROM_FLOODING_TODAY: str + PROPERTIES_AT_RISK_FROM_FLOODING_IN_30_YEARS: str + SHARE_OF_PROPERTIES_AT_RISK_FROM_FLOODING_TODAY: str + SHARE_OF_PROPERTIES_AT_RISK_FROM_FLOODING_IN_30_YEARS: str + + def __init__(self): + # define the full path for the input CSV file + self.INPUT_CSV = ( + self.get_tmp_path() / "fsf_flood" / "flood_tract_2010.csv" + ) + + # this is the main dataframe + self.df: pd.DataFrame + + # Start dataset-specific vars here + self.COUNT_PROPERTIES_NATIVE_FIELD_NAME = "count_properties" + self.COUNT_PROPERTIES_AT_RISK_TODAY = "mid_depth_100_year00" + self.COUNT_PROPERTIES_AT_RISK_30_YEARS = "mid_depth_100_year30" + self.CLIP_PROPERTIES_COUNT = 250 + + def transform(self) -> None: + """Reads the unzipped data file into memory and applies the following + transformations to prepare it for the load() method: + + - Renames the Census Tract column to match the other datasets + - Calculates share of properties at risk, left-clipping number of properties at 250 + """ + logger.info("Transforming National Risk Index Data") + + logger.info(self.COLUMNS_TO_KEEP) + # read in the unzipped csv data source then rename the + # Census Tract column for merging + df_fsf_flood_disagg: pd.DataFrame = pd.read_csv( + self.INPUT_CSV, + dtype={self.INPUT_GEOID_TRACT_FIELD_NAME: str}, + low_memory=False, + ) + + df_fsf_flood_disagg[self.GEOID_TRACT_FIELD_NAME] = df_fsf_flood_disagg[ + self.INPUT_GEOID_TRACT_FIELD_NAME + ].str.zfill(11) + + # Because we have some tracts that are listed twice, we aggregate based on + # GEOID10_TRACT. Note that I haven't confirmed this with the FSF boys -- to do! + df_fsf_flood = ( + df_fsf_flood_disagg.groupby(self.GEOID_TRACT_FIELD_NAME) + .sum() + .reset_index() + ) + + df_fsf_flood[self.COUNT_PROPERTIES] = df_fsf_flood[ + self.COUNT_PROPERTIES_NATIVE_FIELD_NAME + ].clip(lower=self.CLIP_PROPERTIES_COUNT) + + df_fsf_flood[self.SHARE_OF_PROPERTIES_AT_RISK_FROM_FLOODING_TODAY] = ( + df_fsf_flood[self.COUNT_PROPERTIES_AT_RISK_TODAY] + / df_fsf_flood[self.COUNT_PROPERTIES] + ) + df_fsf_flood[ + self.SHARE_OF_PROPERTIES_AT_RISK_FROM_FLOODING_IN_30_YEARS + ] = ( + df_fsf_flood[self.COUNT_PROPERTIES_AT_RISK_30_YEARS] + / df_fsf_flood[self.COUNT_PROPERTIES] + ) + + # Assign the final df to the class' output_df for the load method with rename + self.output_df = df_fsf_flood.rename( + columns={ + self.COUNT_PROPERTIES_AT_RISK_TODAY: self.PROPERTIES_AT_RISK_FROM_FLOODING_TODAY, + self.COUNT_PROPERTIES_AT_RISK_30_YEARS: self.PROPERTIES_AT_RISK_FROM_FLOODING_IN_30_YEARS, + } + ) diff --git a/data/data-pipeline/data_pipeline/etl/sources/fsf_wildfire_risk/README.md b/data/data-pipeline/data_pipeline/etl/sources/fsf_wildfire_risk/README.md new file mode 100644 index 000000000..406046796 --- /dev/null +++ b/data/data-pipeline/data_pipeline/etl/sources/fsf_wildfire_risk/README.md @@ -0,0 +1,3 @@ +# FSF wildfire risk data + +Fire risk computed as >= 0.003 burn risk probability \ No newline at end of file diff --git a/data/data-pipeline/data_pipeline/etl/sources/fsf_wildfire_risk/__init__.py b/data/data-pipeline/data_pipeline/etl/sources/fsf_wildfire_risk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/data/data-pipeline/data_pipeline/etl/sources/fsf_wildfire_risk/etl.py b/data/data-pipeline/data_pipeline/etl/sources/fsf_wildfire_risk/etl.py new file mode 100644 index 000000000..2d36a079f --- /dev/null +++ b/data/data-pipeline/data_pipeline/etl/sources/fsf_wildfire_risk/etl.py @@ -0,0 +1,91 @@ +# pylint: disable=unsubscriptable-object +# pylint: disable=unsupported-assignment-operation + +import pandas as pd +from data_pipeline.config import settings + +from data_pipeline.etl.base import ExtractTransformLoad, ValidGeoLevel +from data_pipeline.utils import get_module_logger + +logger = get_module_logger(__name__) + + +class WildfireRiskETL(ExtractTransformLoad): + """ETL class for the First Street Foundation wildfire risk dataset""" + + NAME = "fsf_wildfire_risk" + SOURCE_URL = settings.AWS_JUSTICE40_DATASOURCES_URL + "/fsf_fire.zip" + GEO_LEVEL = ValidGeoLevel.CENSUS_TRACT + + # Output score variables (values set on datasets.yml) for linting purposes + COUNT_PROPERTIES: str + PROPERTIES_AT_RISK_FROM_FIRE_TODAY: str + PROPERTIES_AT_RISK_FROM_FIRE_IN_30_YEARS: str + SHARE_OF_PROPERTIES_AT_RISK_FROM_FIRE_TODAY: str + SHARE_OF_PROPERTIES_AT_RISK_FROM_FIRE_IN_30_YEARS: str + + def __init__(self): + # define the full path for the input CSV file + self.INPUT_CSV = ( + self.get_tmp_path() / "fsf_fire" / "fire_tract_2010.csv" + ) + + # this is the main dataframe + self.df: pd.DataFrame + + # Start dataset-specific vars here + self.COUNT_PROPERTIES_NATIVE_FIELD_NAME = "count_properties" + self.COUNT_PROPERTIES_AT_RISK_TODAY = "burnprob_year00_flag" + self.COUNT_PROPERTIES_AT_RISK_30_YEARS = "burnprob_year30_flag" + self.CLIP_PROPERTIES_COUNT = 250 + + def transform(self) -> None: + """Reads the unzipped data file into memory and applies the following + transformations to prepare it for the load() method: + + - Renames the Census Tract column to match the other datasets + - Calculates share of properties at risk, left-clipping number of properties at 250 + """ + logger.info("Transforming National Risk Index Data") + + logger.info(self.COLUMNS_TO_KEEP) + # read in the unzipped csv data source then rename the + # Census Tract column for merging + df_fsf_fire_disagg: pd.DataFrame = pd.read_csv( + self.INPUT_CSV, + dtype={self.INPUT_GEOID_TRACT_FIELD_NAME: str}, + low_memory=False, + ) + + df_fsf_fire_disagg[self.GEOID_TRACT_FIELD_NAME] = df_fsf_fire_disagg[ + self.INPUT_GEOID_TRACT_FIELD_NAME + ].str.zfill(11) + + # Because we have some tracts that are listed twice, we aggregate based on + # GEOID10_TRACT. Note that I haven't confirmed this with the FSF boys -- to do! + df_fsf_fire = ( + df_fsf_fire_disagg.groupby(self.GEOID_TRACT_FIELD_NAME) + .sum() + .reset_index() + ) + + df_fsf_fire[self.COUNT_PROPERTIES] = df_fsf_fire[ + self.COUNT_PROPERTIES_NATIVE_FIELD_NAME + ].clip(lower=self.CLIP_PROPERTIES_COUNT) + + df_fsf_fire[self.SHARE_OF_PROPERTIES_AT_RISK_FROM_FIRE_TODAY] = ( + df_fsf_fire[self.COUNT_PROPERTIES_AT_RISK_TODAY] + / df_fsf_fire[self.COUNT_PROPERTIES] + ) + df_fsf_fire[self.SHARE_OF_PROPERTIES_AT_RISK_FROM_FIRE_IN_30_YEARS] = ( + df_fsf_fire[self.COUNT_PROPERTIES_AT_RISK_30_YEARS] + / df_fsf_fire[self.COUNT_PROPERTIES] + ) + + # Assign the final df to the class' output_df for the load method with rename + self.output_df = df_fsf_fire.rename( + columns={ + self.COUNT_PROPERTIES_AT_RISK_TODAY: self.PROPERTIES_AT_RISK_FROM_FIRE_TODAY, + self.COUNT_PROPERTIES_AT_RISK_30_YEARS: self.PROPERTIES_AT_RISK_FROM_FIRE_IN_30_YEARS, + } + ) diff --git a/data/data-pipeline/data_pipeline/score/adding_variables_to_score.md b/data/data-pipeline/data_pipeline/score/adding_variables_to_score.md new file mode 100644 index 000000000..c57e15f44 --- /dev/null +++ b/data/data-pipeline/data_pipeline/score/adding_variables_to_score.md @@ -0,0 +1,28 @@ +# How to add variables to a score + +So, there's a variable you want to add to the score! Once you have the data source created in `etl/sources`, what should you do? There are 6 steps across a minimum of 7 files. + +__Updating `field_names.py`__ +Per indicator, you need to make (usually) three variables to get used in other files. +- raw variable: this is the name of the variable's raw data, not scaled into a percentile +- variable with threshold exceeded: this is a boolean for whether the tract meets the threshold for the indicator alone +- variable with threshold exceeded and socioeconomic criterion exceeded: this is whether the tract will be a DAC based on the socioeconomic criterion and the indicator + +__Updating `etl_score.py`__ +- add the dataframe from the source to the ScoreETL constructor and add a line to read the dataframe into memory +- then, add the dataframe into the list of `census_tract_dfs` +- finally, add columns you want to include as percentiles to the `numeric_columns` list + +__Updating `score_narwhal.py`__ (or whatever the score file is) +- per factor, add the columns that show the threshold and socioeconomic criterion is exceeded to the `eligibility_columns` list +- construct all columns specified in `field_names`, using the factor method as a guide + +__Updating `constants.py`__ +- add the columns' shortnames to the tiles dictionary (using Vim's UI sheet to guide short names) +- add the floats to the list of floats + +__Updating `csv.yml` and `excel.yml`__ +- make sure each column you want to be in the downloadable files is listed here + +__Update the fixtures__ +Follow the instructions on the repo to modify tiles so that `test_etl_post.py` doesn't fail. Then, confirm results. \ No newline at end of file diff --git a/data/data-pipeline/data_pipeline/score/field_names.py b/data/data-pipeline/data_pipeline/score/field_names.py index 41af88daf..a357786c2 100644 --- a/data/data-pipeline/data_pipeline/score/field_names.py +++ b/data/data-pipeline/data_pipeline/score/field_names.py @@ -1,8 +1,5 @@ # Suffixes PERCENTILE_FIELD_SUFFIX = " (percentile)" -PERCENTILE_URBAN_RURAL_FIELD_SUFFIX = " (percentile urban/rural)" -MIN_MAX_FIELD_SUFFIX = " (min-max normalized)" -TOP_25_PERCENTILE_SUFFIX = " (top 25th percentile)" ISLAND_AREAS_PERCENTILE_ADJUSTMENT_FIELD = " for island areas" # Geographic field names @@ -11,38 +8,6 @@ COUNTY_FIELD = "County Name" # Score file field names -SCORE_A = "Score A" -SCORE_B = "Score B" -SCORE_C = "Score C" -C_SOCIOECONOMIC = "Socioeconomic Factors" -C_SENSITIVE = "Sensitive populations" -C_ENVIRONMENTAL = "Environmental effects" -C_EXPOSURES = "Exposures" -SCORE_D = "Score D" -SCORE_E = "Score E" -SCORE_F_COMMUNITIES = "Score F (communities)" -SCORE_G = "Score G" -SCORE_G_COMMUNITIES = "Score G (communities)" -SCORE_H = "Score H" -SCORE_H_COMMUNITIES = "Score H (communities)" -SCORE_I = "Score I" -SCORE_I_COMMUNITIES = "Score I (communities)" -SCORE_K = "NMTC (communities)" -SCORE_K_COMMUNITIES = "Score K (communities)" - -# Definition L fields -SCORE_L = "Definition L" -SCORE_L_COMMUNITIES = "Definition L (communities)" -L_CLIMATE = "Climate Factor (Definition L)" -L_ENERGY = "Energy Factor (Definition L)" -L_TRANSPORTATION = "Transportation Factor (Definition L)" -L_HOUSING = "Housing Factor (Definition L)" -L_POLLUTION = "Pollution Factor (Definition L)" -L_WATER = "Water Factor (Definition L)" -L_HEALTH = "Health Factor (Definition L)" -L_WORKFORCE = "Workforce Factor (Definition L)" -L_NON_WORKFORCE = "Any Non-Workforce Factor (Definition L)" - # Definition M fields SCORE_M = "Definition M" SCORE_M_COMMUNITIES = "Definition M (communities)" @@ -85,25 +50,6 @@ "Both workforce socioeconomic indicators exceeded" ) -# For now, these are not used. Will delete after following up with Vim. -POLLUTION_SOCIO_INDICATORS_EXCEEDED = ( - "Both pollution socioeconomic indicators exceeded" -) -CLIMATE_SOCIO_INDICATORS_EXCEEDED = ( - "Both climate socioeconomic indicators exceeded" -) -ENERGY_SOCIO_INDICATORS_EXCEEDED = ( - "Both energy socioeconomic indicators exceeded" -) -HOUSING_SOCIO_INDICATORS_EXCEEDED = ( - "Both housing socioeconomic indicators exceeded" -) -WATER_SOCIO_INDICATORS_EXCEEDED = "Both water socioeconomic indicators exceeded" - -HEALTH_SOCIO_INDICATORS_EXCEEDED = ( - "Both health socioeconomic indicators exceeded" -) - # Poverty / Income POVERTY_FIELD = "Poverty (Less than 200% of federal poverty line)" @@ -156,6 +102,8 @@ EXPECTED_POPULATION_LOSS_RATE_FIELD = ( "Expected population loss rate (Natural Hazards Risk Index)" ) +FUTURE_FLOOD_RISK_FIELD = "Share of properties at risk of flood in 30 years" +FUTURE_WILDFIRE_RISK_FIELD = "Share of properties at risk of fire in 30 years" # Environment DIESEL_FIELD = "Diesel particulate matter exposure" @@ -408,6 +356,15 @@ ) AGRICULTURAL_VALUE_BOOL_FIELD = "Contains agricultural value" +HIGH_FUTURE_FLOOD_RISK_LOW_INCOME_FIELD = ( + f"Greater than or equal to the {PERCENTILE}th percentile for share of " + "properties at risk of flood in 30 years and is low income?" +) +HIGH_FUTURE_WILDFIRE_RISK_LOW_INCOME_FIELD = ( + f"Greater than or equal to the {PERCENTILE}th percentile for " + "share of properties at risk of fire in 30 years and is low income?" +) + # Clean energy and efficiency PM25_EXPOSURE_LOW_INCOME_FIELD = f"Greater than or equal to the {PERCENTILE}th percentile for PM2.5 exposure and is low income?" ENERGY_BURDEN_LOW_INCOME_FIELD = f"Greater than or equal to the {PERCENTILE}th percentile for energy burden and is low income?" @@ -670,6 +627,16 @@ UNEMPLOYMENT_PCTILE_THRESHOLD = ( f"Greater than or equal to the {PERCENTILE}th percentile for unemployment" ) +HIGH_FUTURE_FLOOD_RISK_FIELD = ( + f"Greater than or equal to the {PERCENTILE}th percentile for share of properties " + "at risk of flood in 30 years" +) +HIGH_FUTURE_WILDFIRE_RISK_FIELD = ( + f"Greater than or equal to the {PERCENTILE}th percentile for share of properties " + "at risk of fire in 30 years" +) + + LINGUISTIC_ISOLATION_PCTILE_THRESHOLD = f"Greater than or equal to the {PERCENTILE}th percentile for households in linguistic isolation" POVERTY_PCTILE_THRESHOLD = f"Greater than or equal to the {PERCENTILE}th percentile for households at or below 100% federal poverty level" LOW_MEDIAN_INCOME_PCTILE_THRESHOLD = ( diff --git a/data/data-pipeline/data_pipeline/score/score_narwhal.py b/data/data-pipeline/data_pipeline/score/score_narwhal.py index 3c554fc5b..4f354b0e8 100644 --- a/data/data-pipeline/data_pipeline/score/score_narwhal.py +++ b/data/data-pipeline/data_pipeline/score/score_narwhal.py @@ -122,8 +122,13 @@ def _climate_factor(self) -> bool: field_names.EXPECTED_POPULATION_LOSS_RATE_LOW_INCOME_FIELD, field_names.EXPECTED_AGRICULTURE_LOSS_RATE_LOW_INCOME_FIELD, field_names.EXPECTED_BUILDING_LOSS_RATE_LOW_INCOME_FIELD, + field_names.HIGH_FUTURE_FLOOD_RISK_LOW_INCOME_FIELD, + field_names.HIGH_FUTURE_WILDFIRE_RISK_LOW_INCOME_FIELD, ] + # TODO: When we refactor this... it's the same code over and over and over again + # We should make a function, _get_all_columns(), that returns all three of these columns + self.df[ field_names.EXPECTED_POPULATION_LOSS_EXCEEDS_PCTILE_THRESHOLD ] = ( @@ -152,6 +157,22 @@ def _climate_factor(self) -> bool: >= self.ENVIRONMENTAL_BURDEN_THRESHOLD ) + self.df[field_names.HIGH_FUTURE_FLOOD_RISK_FIELD] = ( + self.df[ + field_names.FUTURE_FLOOD_RISK_FIELD + + field_names.PERCENTILE_FIELD_SUFFIX + ] + >= self.ENVIRONMENTAL_BURDEN_THRESHOLD + ) + + self.df[field_names.HIGH_FUTURE_WILDFIRE_RISK_FIELD] = ( + self.df[ + field_names.FUTURE_WILDFIRE_RISK_FIELD + + field_names.PERCENTILE_FIELD_SUFFIX + ] + >= self.ENVIRONMENTAL_BURDEN_THRESHOLD + ) + self.df[field_names.CLIMATE_THRESHOLD_EXCEEDED] = ( self.df[ field_names.EXPECTED_POPULATION_LOSS_EXCEEDS_PCTILE_THRESHOLD @@ -162,6 +183,8 @@ def _climate_factor(self) -> bool: | self.df[ field_names.EXPECTED_BUILDING_LOSS_EXCEEDS_PCTILE_THRESHOLD ] + | self.df[field_names.HIGH_FUTURE_WILDFIRE_RISK_FIELD] + | self.df[field_names.HIGH_FUTURE_FLOOD_RISK_FIELD] ) self.df[field_names.EXPECTED_POPULATION_LOSS_RATE_LOW_INCOME_FIELD] = ( @@ -183,6 +206,16 @@ def _climate_factor(self) -> bool: & self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED] ) + self.df[field_names.HIGH_FUTURE_FLOOD_RISK_LOW_INCOME_FIELD] = ( + self.df[field_names.HIGH_FUTURE_FLOOD_RISK_FIELD] + & self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED] + ) + + self.df[field_names.HIGH_FUTURE_WILDFIRE_RISK_LOW_INCOME_FIELD] = ( + self.df[field_names.HIGH_FUTURE_WILDFIRE_RISK_FIELD] + & self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED] + ) + self._increment_total_eligibility_exceeded( climate_eligibility_columns, skip_fips=constants.DROP_FIPS_FROM_NON_WTD_THRESHOLDS, @@ -865,11 +898,6 @@ def add_columns(self) -> pd.DataFrame: self.df[field_names.THRESHOLD_COUNT] = 0 - # TODO: move this inside of - # `_create_low_income_and_low_college_attendance_threshold` - # and change the return signature of that method. - # Create a standalone field that captures the college attendance boolean - # threshold. self.df[field_names.FPL_200_SERIES_IMPUTED_AND_ADJUSTED] = ( self.df[ # UPDATE: Pull the imputed poverty statistic diff --git a/data/data-pipeline/data_pipeline/score/score_runner.py b/data/data-pipeline/data_pipeline/score/score_runner.py index e3db6c39a..54b5c8787 100644 --- a/data/data-pipeline/data_pipeline/score/score_runner.py +++ b/data/data-pipeline/data_pipeline/score/score_runner.py @@ -1,13 +1,4 @@ import pandas as pd -from data_pipeline.score.score_a import ScoreA -from data_pipeline.score.score_b import ScoreB -from data_pipeline.score.score_c import ScoreC -from data_pipeline.score.score_f import ScoreF -from data_pipeline.score.score_g import ScoreG -from data_pipeline.score.score_h import ScoreH -from data_pipeline.score.score_i import ScoreI -from data_pipeline.score.score_k import ScoreK -from data_pipeline.score.score_l import ScoreL from data_pipeline.score.score_m import ScoreM from data_pipeline.score.score_narwhal import ScoreNarwhal @@ -23,15 +14,6 @@ def __init__(self, df: pd.DataFrame): def calculate_scores(self) -> pd.DataFrame: # Index scores - self.df = ScoreA(df=self.df).add_columns() - self.df = ScoreB(df=self.df).add_columns() - self.df = ScoreC(df=self.df).add_columns() - self.df = ScoreF(df=self.df).add_columns() - self.df = ScoreG(df=self.df).add_columns() - self.df = ScoreH(df=self.df).add_columns() - self.df = ScoreI(df=self.df).add_columns() - self.df = ScoreK(df=self.df).add_columns() - self.df = ScoreL(df=self.df).add_columns() self.df = ScoreM(df=self.df).add_columns() self.df = ScoreNarwhal(df=self.df).add_columns()