usds / justice40-tool

A tool to identify disadvantaged communities due to environmental, socioeconomic and health burdens
https://screeningtool.geoplatform.gov/
Creative Commons Zero v1.0 Universal
133 stars 42 forks source link

Building value is not blue for census tract 31075956300 even though it is 90th #1053

Closed BethMattern closed 2 years ago

BethMattern commented 2 years ago

The building value field should be blue in the side panel for census tract 31075956300 https://d29zfl8cj7y1zf.cloudfront.net/en/cejst#10.17/41.9023/-101.7773

lucasmbrown-usds commented 2 years ago

The data is ~0.897. so when we determine whether that is >=90th percentile, it is NOT and so it is NOT included. But when we round the number for the UI, it looks like 90.

This will affect ALL percentile fields for all values between .895 and .8999999999.

I think we need a steer from design/product (@BethMattern @glennettec @KameronKerger ) on how they want this to look.

Some options:

lucasmbrown-usds commented 2 years ago

Another option: if we're going to essentially use "floors" for our percentile cutoffs where .89999999 is not above the threshold but .90 is, then perhaps we should no longer round numbers anywhere, and instead always floor them (e.g., .899999 goes to .89, and so does, e.g., .7363459342 to .73). This would be consistent and also make the thresholds match. It's also a fairly trivial backend change.

switzersc-usds commented 2 years ago

We will do that.

esfoobar-usds commented 2 years ago

This is where we round -- we use Pandas.round: https://github.com/usds/justice40-tool/blob/main/data/data-pipeline/data_pipeline/etl/score/etl_score_post.py#L216

BethMattern commented 2 years ago

@saran-ahluwalia is this the rounding thing you talked about in standup today?

saran-ahluwalia commented 2 years ago

Yes @BethMattern, I believe that this is the main issue associated with the current task.

saran-ahluwalia commented 2 years ago

@esfoobar-usds @BethMattern Is there any other QA and/or additional client-side validation that needs to occur before this is closed?

esfoobar-usds commented 2 years ago

Your round PR should take care of this, but we'll double check shortly.