Skip to content

Commit

Permalink
updating
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmbrown-usds committed Aug 17, 2022
1 parent 47d81d0 commit 7d89682
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 9 deletions.
24 changes: 24 additions & 0 deletions data/data-pipeline/data_pipeline/content/config/csv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 24 additions & 1 deletion data/data-pipeline/data_pipeline/content/config/excel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

17 changes: 17 additions & 0 deletions data/data-pipeline/data_pipeline/etl/score/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
]
8 changes: 8 additions & 0 deletions data/data-pipeline/data_pipeline/etl/score/etl_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions data/data-pipeline/data_pipeline/score/field_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 7d89682

Please sign in to comment.