azavea / pfb-network-connectivity

PFB Bicycle Network Connectivity
Other
40 stars 10 forks source link

Switch 'N/A' to 'No data' and use it when jobs score is zero #906

Closed KlaasH closed 1 year ago

KlaasH commented 1 year ago

Overview

In PR #879 we changed the front end to show "N/A" when the score for a destination type comes out as zero due to there not being any of that type of destination in the data, as opposed to there being locations but they're 100% inaccessible via low-stress routes. There are in fact cases of the latter, so we couldn't just change all zeroes to "N/A".

This changes the annotation from "N/A" to "No data" and also applies it to the "Employment" line. But since employment isn't a destination type, we couldn't use the same "are there any actual locations?" test to decide whether a value is a true zero or a "no data" situation. Fortunately, there don't appear to be any true zeroes in the analysis jobs that have been run to date--I looked in the production database, and all the zero values were from non-US cities that appear to have been run without jobs data (and were subsequently updated to include it). So this just treats an employment score of exactly zero as "No data".

Demo

image

Notes

Applying this in the front end rather than in the analysis has some advantages and some disadvantages. The former include:

The main disadvantage is that the distinction is not conclusively captured by the output of the analysis. The "Overall Scores (csv)" file will continue showing zeroes, so anything besides the front end that wants to distinguish between true zeroes and no-data cases will have to independently apply the same heuristics the front end does.

Testing Instructions

Checklist

lydiascarf commented 1 year ago

lgtm! I'll approve when I'm done testing, but feel free to merge if you don't want to wait