diff --git a/data/data-pipeline/data_pipeline/content/config/csv.yml b/data/data-pipeline/data_pipeline/content/config/csv.yml index 4f074df58..f081652b9 100644 --- a/data/data-pipeline/data_pipeline/content/config/csv.yml +++ b/data/data-pipeline/data_pipeline/content/config/csv.yml @@ -14,6 +14,30 @@ fields: - score_name: State/Territory label: State/Territory format: string + - score_name: Percent Black or African Amer. + label: Percent Black or African American alone + format: float + - score_name: Percent Amer. Indian / Alaska Native + label: Percent Amer. Indian / Alaska Native + format: float + - score_name: Percent Asian + label: Percent Asian + format: float + - score_name: Percent Native Hawaiian or Pacific + label: Percent Native Hawaiian or Pacific + format: float + - score_name: Percent Two or more + label: Percent Two or more + format: float + - score_name: Percent White + label: Percent White + format: float + - score_name: Percent Hispanic or Latino + label: Percent Hispanic or Latino + format: float + - score_name: Percent Other + label: Percent Other + format: float - score_name: Total threshold criteria exceeded label: Total threshold criteria exceeded format: int64 diff --git a/data/data-pipeline/data_pipeline/content/config/excel.yml b/data/data-pipeline/data_pipeline/content/config/excel.yml index 0659eddb3..76199d5ad 100644 --- a/data/data-pipeline/data_pipeline/content/config/excel.yml +++ b/data/data-pipeline/data_pipeline/content/config/excel.yml @@ -18,6 +18,30 @@ sheets: - score_name: State/Territory label: State/Territory format: string + - score_name: Percent Black or African Amer. + label: Percent Black or African American alone + format: float + - score_name: Percent Amer. Indian / Alaska Native + label: Percent Amer. Indian / Alaska Native + format: float + - score_name: Percent Asian + label: Percent Asian + format: float + - score_name: Percent Native Hawaiian or Pacific + label: Percent Native Hawaiian or Pacific + format: float + - score_name: Percent Two or more + label: Percent Two or more + format: float + - score_name: Percent White + label: Percent White + format: float + - score_name: Percent Hispanic or Latino + label: Percent Hispanic or Latino + format: float + - score_name: Percent Other + label: Percent Other + format: float - score_name: Total threshold criteria exceeded label: Total threshold criteria exceeded format: int64 @@ -315,4 +339,3 @@ sheets: - score_name: Does the tract have at least 35 acres in it? label: Does the tract have at least 35 acres in it? format: bool - \ No newline at end of file diff --git a/data/data-pipeline/data_pipeline/etl/score/constants.py b/data/data-pipeline/data_pipeline/etl/score/constants.py index 50e523cf2..a7414959f 100644 --- a/data/data-pipeline/data_pipeline/etl/score/constants.py +++ b/data/data-pipeline/data_pipeline/etl/score/constants.py @@ -310,6 +310,14 @@ field_names.NON_NATURAL_LOW_INCOME_FIELD_NAME: "IS_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) + field_names.PERCENT_BLACK_FIELD_NAME: "DM_B", + field_names.PERCENT_AMERICAN_INDIAN_FIELD_NAME: "DM_AI", + field_names.PERCENT_ASIAN_FIELD_NAME: "DM_A", + field_names.PERCENT_HAWAIIAN_FIELD_NAME: "DM_HI", + field_names.PERCENT_TWO_OR_MORE_RACES_FIELD_NAME: "DM_T", + field_names.PERCENT_NON_HISPANIC_WHITE_FIELD_NAME: "DM_W", + field_names.PERCENT_HISPANIC_FIELD_NAME: "DM_H", + field_names.PERCENT_OTHER_RACE_FIELD_NAME: "DM_O", } # columns to round floats to 2 decimals @@ -366,4 +374,13 @@ + field_names.PERCENTILE_FIELD_SUFFIX, field_names.TRACT_PERCENT_NON_NATURAL_FIELD_NAME + field_names.PERCENTILE_FIELD_SUFFIX, + # Include demographic data for sidebar -- as percents, NOT as percentiles. + field_names.PERCENT_BLACK_FIELD_NAME, + field_names.PERCENT_AMERICAN_INDIAN_FIELD_NAME, + field_names.PERCENT_ASIAN_FIELD_NAME, + field_names.PERCENT_HAWAIIAN_FIELD_NAME, + field_names.PERCENT_TWO_OR_MORE_RACES_FIELD_NAME, + field_names.PERCENT_NON_HISPANIC_WHITE_FIELD_NAME, + field_names.PERCENT_HISPANIC_FIELD_NAME, + field_names.PERCENT_OTHER_RACE_FIELD_NAME, ] 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 0d942d5c0..5204741c2 100644 --- a/data/data-pipeline/data_pipeline/etl/score/etl_score.py +++ b/data/data-pipeline/data_pipeline/etl/score/etl_score.py @@ -449,6 +449,14 @@ def _prepare_initial_df(self) -> pd.DataFrame: field_names.FUTURE_WILDFIRE_RISK_FIELD, field_names.TRACT_PERCENT_NON_NATURAL_FIELD_NAME, field_names.POVERTY_LESS_THAN_200_FPL_IMPUTED_FIELD, + field_names.PERCENT_BLACK_FIELD_NAME, + field_names.PERCENT_AMERICAN_INDIAN_FIELD_NAME, + field_names.PERCENT_ASIAN_FIELD_NAME, + field_names.PERCENT_HAWAIIAN_FIELD_NAME, + field_names.PERCENT_TWO_OR_MORE_RACES_FIELD_NAME, + field_names.PERCENT_NON_HISPANIC_WHITE_FIELD_NAME, + field_names.PERCENT_HISPANIC_FIELD_NAME, + field_names.PERCENT_OTHER_RACE_FIELD_NAME, ] non_numeric_columns = [ diff --git a/data/data-pipeline/data_pipeline/etl/sources/census_acs/etl.py b/data/data-pipeline/data_pipeline/etl/sources/census_acs/etl.py index a3757d13c..52dd9274d 100644 --- a/data/data-pipeline/data_pipeline/etl/sources/census_acs/etl.py +++ b/data/data-pipeline/data_pipeline/etl/sources/census_acs/etl.py @@ -190,7 +190,6 @@ def __init__(self): ] # Name output demographics fields. - self.RE_OUTPUT_FIELDS = [ field_names.BLACK_FIELD_NAME, field_names.AMERICAN_INDIAN_FIELD_NAME, diff --git a/data/data-pipeline/data_pipeline/score/field_names.py b/data/data-pipeline/data_pipeline/score/field_names.py index 835a06b1e..24e3bbbd5 100644 --- a/data/data-pipeline/data_pipeline/score/field_names.py +++ b/data/data-pipeline/data_pipeline/score/field_names.py @@ -92,14 +92,14 @@ ) # Additional ACS demographic fields. -BLACK_FIELD_NAME = "Black or African American alone" -AMERICAN_INDIAN_FIELD_NAME = "American Indian and Alaska Native alone" -ASIAN_FIELD_NAME = "Asian alone" -HAWAIIAN_FIELD_NAME = "Native Hawaiian and Other Pacific alone" -TWO_OR_MORE_RACES_FIELD_NAME = "Two or more races" -NON_HISPANIC_WHITE_FIELD_NAME = "Non-Hispanic White" +BLACK_FIELD_NAME = "Black or African Amer." +AMERICAN_INDIAN_FIELD_NAME = "Amer. Indian / Alaska Native" +ASIAN_FIELD_NAME = "Asian" +HAWAIIAN_FIELD_NAME = "Native Hawaiian or Pacific" +TWO_OR_MORE_RACES_FIELD_NAME = "Two or more" +NON_HISPANIC_WHITE_FIELD_NAME = "White" HISPANIC_FIELD_NAME = "Hispanic or Latino" -OTHER_RACE_FIELD_NAME = "Some other race alone" +OTHER_RACE_FIELD_NAME = "Other" # Same fields, but with a percent prefix PERCENT_PREFIX = "Percent "