From 327e27e71314ee0cbeb7ad892f0cde992a9d419f Mon Sep 17 00:00:00 2001 From: Jorge Escobar <83969469+esfoobar-usds@users.noreply.github.com> Date: Wed, 8 Sep 2021 16:44:26 -0400 Subject: [PATCH] Add Score D to USA Low (#629) * added score D * Adding Score D to usa-low * rounding score d * small vscode update * last couple of vscode changes * uncommited bscode changes --- data/data-pipeline/.vscode/launch.json | 10 ---------- data/data-pipeline/.vscode/tasks.json | 14 +++++--------- .../data_pipeline/etl/score/etl_score_geo.py | 8 ++++++-- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/data/data-pipeline/.vscode/launch.json b/data/data-pipeline/.vscode/launch.json index 5603df9a..42bb1622 100644 --- a/data/data-pipeline/.vscode/launch.json +++ b/data/data-pipeline/.vscode/launch.json @@ -94,15 +94,5 @@ "update" ] }, - { - "name": "upload map tiles to s3", - "type": "bash", - "request": "launch", - "module": "poetry", - "args": [ - "update" - ] - }, - // aws s3 sync ./data_pipeline/data/score/tiles/ s3://justice40-data/data-pipeline/data/score/tiles --acl public-read --delete ] } diff --git a/data/data-pipeline/.vscode/tasks.json b/data/data-pipeline/.vscode/tasks.json index 8b8c767f..37c0a5a3 100644 --- a/data/data-pipeline/.vscode/tasks.json +++ b/data/data-pipeline/.vscode/tasks.json @@ -39,15 +39,11 @@ { "label": "Upload tiles to S3", "type": "shell", - "command": "aws", - "args": [ - "s3", - "sync", - "./data_pipeline/data/score/tiles/", - "s3://justice40-data/data-pipeline/data/score/tiles", - "--acl public-read", - "--delete" - ] + "command": "aws s3 sync ./data_pipeline/data/score/tiles/ s3://justice40-data/data-pipeline/data/score/tiles --acl public-read --delete", + "presentation": { + "reveal": "always", + "panel": "new" + } }, ] } diff --git a/data/data-pipeline/data_pipeline/etl/score/etl_score_geo.py b/data/data-pipeline/data_pipeline/etl/score/etl_score_geo.py index 2394f9a7..50172186 100644 --- a/data/data-pipeline/data_pipeline/etl/score/etl_score_geo.py +++ b/data/data-pipeline/data_pipeline/etl/score/etl_score_geo.py @@ -26,8 +26,8 @@ class GeoScoreETL(ExtractTransformLoad): self.DATA_PATH / "census" / "geojson" / "us.json" ) - self.TARGET_SCORE_NAME = "Score E (percentile)" - self.TARGET_SCORE_RENAME_TO = "E_SCORE" + self.TARGET_SCORE_NAME = "Score D (percentile)" + self.TARGET_SCORE_RENAME_TO = "D_SCORE" self.NUMBER_OF_BUCKETS = 10 @@ -103,6 +103,10 @@ class GeoScoreETL(ExtractTransformLoad): crs="EPSG:4326", ) + # round to 2 decimals + decimals = pd.Series([2], index=[self.TARGET_SCORE_RENAME_TO]) + self.geojson_score_usa_low = self.geojson_score_usa_low.round(decimals) + def _aggregate_to_tracts( self, block_group_df: gpd.GeoDataFrame ) -> gpd.GeoDataFrame: