UrbanInstitute / prison-population-forecaster

Translating the Prison Population Forecaster R script to javascript
5 stars 3 forks source link

Selecting a group category and one of its individual items yields an error #11

Closed DanielJWood closed 6 years ago

DanielJWood commented 7 years ago

When you select a group category like "All Property" and additional select and edit one of its children (i.e. "burglary") for the same type of change (i.e. "LOS" vs. "entrance), the algorithm in js doesn't deduplicate that overlap yielding incorrect results, relative to the R script.

DanielJWood commented 7 years ago

Should be able to remedy in the "expand scenario" section of the code.

bchartoff commented 7 years ago

This is also a UI challenge (what happens if user selects umbrella category then selects child? What about child them umbrella? How does this look and behave?) So as we develop wire frames we'll make sure we close this issue in the appropriate manner.

bchartoff commented 7 years ago

Tagging in @mdebranski who will be working on the UI/X solution

DanielJWood commented 7 years ago

@bchartoff regardless of how it looks, I think, functionally, the ideal scenario would be to allow child categories be adjusted even when an umbrella category is in play. For instance you should be able to set "all property" to -40% for entrances but make burglary +20% for entrances.

bchartoff commented 7 years ago

@DanielJWood yeah I agree we need the functionality for "all but X", so if you're itching to add that to model go for it, but I wouldn't close the ticket even so. There's just a lot of complexity here (including toggling on/off each scenario, or multiple scenarios for the same offense (changing LOS and E independently) and I want to keep umbrella weirdness on our radar as we explore UI.

bchartoff commented 6 years ago

This is no longer an issue, I think, UI solved it hooray! I'm actually not passing in any umbrella categories, just looping through each child and passing in it's value (so if all violent is set to -20% I'm just passing in -20 for assault, homicide, etc