Skip to content

Commit

Permalink
Floor in a simpler way (#2033)
Browse files Browse the repository at this point in the history
Emma pointed out that all teh stuff we're doing in floor_series is
probably unnecessary for this case, so just use the built-in floor.
  • Loading branch information
mattbowen-usds committed Oct 26, 2022
1 parent cf785cf commit d224968
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions data/data-pipeline/data_pipeline/etl/score/etl_score_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,10 @@ def _create_tile_data(
for col, col_dtype in score_tiles.dtypes.items()
if col_dtype == np.dtype("float64")
]
score_tiles[float_cols] = score_tiles[float_cols].apply(
func=lambda series: floor_series(
series=series,
number_of_decimals=constants.TILES_ROUND_NUM_DECIMALS,
),
axis=0,
)
scale_factor = 10**constants.TILES_ROUND_NUM_DECIMALS
score_tiles[float_cols] = (
score_tiles[float_cols] * scale_factor
).apply(np.floor) / scale_factor

logger.info("Adding fields for island areas and Puerto Rico")
# The below operation constructs variables for the front end.
Expand Down

0 comments on commit d224968

Please sign in to comment.