-
Notifications
You must be signed in to change notification settings - Fork 16
USAFacts Prop Fix #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USAFacts Prop Fix #533
Conversation
* same megafips filter when converting to state as in JHU
|
Also a longterm thought: the way fips to state conversion works GeoMapper seems to be dangerous for prop signals. Maybe it would be best to update the function to filter out megafips by default. I don't think there are cases where we want to keep the megafips data when converting to state? |
|
Let me suggest that we also need a unit test here. This bug has already popped up twice in different indicators; if there's a way to test |
Can you be more specific? Because I'm pretty sure we only want to jettison megafips population -- numerator counts etc should be retained. |
Agree this PR should include a unit test to prevent regression in future.
...unfortunately I don't think it's possible to test the current behavior in a way that's robust to adding new indicators susceptible to the same problem. We'd have to shift prop computations into the utility to do that -- which might be a good idea regardless -- but is too big a task for a hotfix like this. I'll put it on the schedule for December at least, and see if there's anything we can rearrange to get a head start on it this month. |
|
Test is in; verified fails in main and succeeds in this PR. |
I don't understand why you can't test this. |
sgsmob
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks pretty good to me. I don't have a ton of USAFacts background to know if this is going to cause more issues, but if it worked in JHU, that seems pretty good.
| "new_counts": [10, 15, 2, 13, 0], | ||
| "cumulative_counts": [100, 20, 45, 60, 0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these always assumed to be 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but it was the minimum change to the tests that failed in main and succeeded with the fix.

Description
Same half-correct prop signal value that JHU was having #328
Changelog
@sgsmob can you foresee any problems with this sort of fix here? Passed my sanity checks, but I'm not familiar with this indicator.
Fixes
Fixes #536