Skip to content

Commit

Permalink
Add tribal overlap to downloads (#1907)
Browse files Browse the repository at this point in the history
* Add tribal data to downloads (#1904)

* Update test pickle with current cols (#1904)

* Remove text of tribe names from GeoJSON (#1904)

* Update test data (#1904)

* Add tribal overlap to smoketests (#1904)
  • Loading branch information
mattbowen-usds authored Sep 23, 2022
1 parent 6e0ef33 commit 9e85375
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 3 deletions.
9 changes: 9 additions & 0 deletions data/data-pipeline/data_pipeline/content/config/csv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,12 @@ fields:
- score_name: Income data has been estimated based on neighbor income
label: Income data has been estimated based on geographic neighbor income
format: bool
- score_name: Number of Tribal areas within Census tract
label: Number of Tribal areas within Census tract
format: int64
- score_name: Names of Tribal areas within Census tract
label: Names of Tribal areas within Census tract
format: string
- score_name: Percent of the Census tract that is within Tribal areas
label: Percent of the Census tract that is within Tribal areas
format: percentage
9 changes: 9 additions & 0 deletions data/data-pipeline/data_pipeline/content/config/excel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,12 @@ sheets:
- score_name: Income data has been estimated based on neighbor income
label: Income data has been estimated based on geographic neighbor income
format: bool
- score_name: Number of Tribal areas within Census tract
label: Number of Tribal areas within Census tract
format: int64
- score_name: Names of Tribal areas within Census tract
label: Names of Tribal areas within Census tract
format: string
- score_name: Percent of the Census tract that is within Tribal areas
label: Percent of the Census tract that is within Tribal areas
format: percentage
5 changes: 5 additions & 0 deletions data/data-pipeline/data_pipeline/etl/score/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@
field_names.PERCENT_AGE_UNDER_10: "AGE_10",
field_names.PERCENT_AGE_10_TO_64: "AGE_MIDDLE",
field_names.PERCENT_AGE_OVER_64: "AGE_OLD",
field_names.COUNT_OF_TRIBAL_AREAS_IN_TRACT: "TA_COUNT",
field_names.PERCENT_OF_TRIBAL_AREA_IN_TRACT: "TA_PERC",


}

# columns to round floats to 2 decimals
Expand Down Expand Up @@ -452,4 +456,5 @@
field_names.ELIGIBLE_FUDS_BINARY_FIELD_NAME,
field_names.AML_BOOLEAN,
field_names.HISTORIC_REDLINING_SCORE_EXCEEDED,
field_names.PERCENT_OF_TRIBAL_AREA_IN_TRACT
]

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions data/data-pipeline/data_pipeline/tests/score/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,16 @@ def national_tract_df():
low_memory=False,
header=None,
)


@pytest.fixture()
def tribal_overlap():
tribal_overlap = (
constants.DATA_PATH / "dataset" / "tribal_overlap" / "usa.csv"
)

return pd.read_csv(
tribal_overlap,
dtype={GEOID_TRACT_FIELD: "string"},
low_memory=False,
)
2 changes: 2 additions & 0 deletions data/data-pipeline/data_pipeline/tests/score/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
census_2010_df,
hrs_df,
national_tract_df,
tribal_overlap,
)


Expand Down Expand Up @@ -249,6 +250,7 @@ def test_data_sources(
census_decennial_df,
census_2010_df,
hrs_df,
tribal_overlap,
):
data_sources = {
key: value for key, value in locals().items() if key != "final_score_df"
Expand Down

0 comments on commit 9e85375

Please sign in to comment.