-
Notifications
You must be signed in to change notification settings - Fork 25
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
Prevent users from auditing a completed neighborhood #691
Comments
This type of pop-up (from #622 (comment)) could address this issue: |
The real issue here is that the queries that get the completion rates of each neighborhood takes a hell of a long time to run (~11 seconds on my local dump). That has been annoying but fine because it was only used on the admin page up until now. I will look closer at what is taking this long, but to get it fast enough way may have to add a table that holds the amount of each neighborhood that has been completed. |
Agreed. If this is a long query, we will have to tabulate it intermittently and store in a table for instant access.
…Sent from my iPhone
On Jun 17, 2017, at 5:48 PM, Mikey Saugstad ***@***.***> wrote:
The real issue here is that the queries) that get the completion rates of each neighborhood takes a hell of a long time to run (~11 seconds on my local dump). That has been annoying but find because it was only used on the admin page up until now.
I will look closer at what is taking this long, but to get it fast enough way may have to add a table the holds the amount of each neighborhood that has been completed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This is likely not the only query that we will have to preprocess and store results in a table (perhaps refreshing every 30 mins to 24 hours depending on importance).
…Sent from my iPhone
On Jun 17, 2017, at 5:48 PM, Mikey Saugstad ***@***.***> wrote:
The real issue here is that the queries) that get the completion rates of each neighborhood takes a hell of a long time to run (~11 seconds on my local dump). That has been annoying but find because it was only used on the admin page up until now.
I will look closer at what is taking this long, but to get it fast enough way may have to add a table the holds the amount of each neighborhood that has been completed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
For this table, the two critical things we need are
This is all that I currently need, but can we think of anything else that should go in there? I am thinking that we can update the completed_distance field whenever someone finishes an street audit. We just increase the completed_distance field for that region by the length of the street that was just audited (we would have to check that the street has not already been audited before adding). |
This seems right.
Re: how to update it? I think incrementally updating it could work;
however, then we would have to make sure that these updates are done
correctly (as you say, would have to check that the street has not already
been audited previously before adding). These cascading calculations, I
think, can often be more trouble than they are worth (e.g., need to also
address cases when an audit gets deleted, though I realize this is not
currently possible).
Any reason why we don't just try the simple approach: which is rerun the
full calculation each night or something. Yes, this is a totally greedy and
naive approach but all it costs is CPU cycles (and a temporary high load on
memory).
Jon
…On Sat, Jun 17, 2017 at 10:27 PM, Mikey Saugstad ***@***.***> wrote:
For this table, the two critical things we need are
1. region_id
2. total_distance (sum of lengths of all streets in the region)
3. completed_distance (sum of lengths of all streets for which someone
has completed an audit)
This is all that I currently need, but can we think of anything else that
should go in there?
I am thinking that we can update the completed_distance field whenever
someone finishes an street audit. We just increase the completed_distance
field for that region by the length of the street that was just audited (we
would have to check that the street has not already been audited before
adding).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#691 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABi-9ZZMLsg-s_rojwh5sORbhH3aZadNks5sFIsogaJpZM4N9VQv>
.
--
Jon Froehlich
Assistant Professor
Computer Science
University of Maryland, College Park
http://www.cs.umd.edu/~jonf/
@jonfroehlich <https://twitter.com/jonfroehlich> - Twitter
|
There is actually a street_edge_assignment_count table that has a completion_count field. So whenever a user finishes auditing a street, the completion_count is incremented by 1 for that edge. Thus checking that the street has not already been audited is very easy. And the reason I strongly believe that it should happen in real time is that users will want to do a mission, then immediately check to see how much of the neighborhood has been audited. It would be disheartening to do 4 missions, then look back at the choropleth and see that the percentage is the same as it was before you started auditing. I just suspect that seeing the choropleth update will be highly motivating! |
I agree w the motivation part. Let's go with what you suggest then!
…Sent from my iPhone
On Jun 18, 2017, at 3:46 PM, Mikey Saugstad ***@***.***> wrote:
There is actually a street_edge_assignment_count table that has a completion_count field. So whenever a user finishes auditing a street, the completion_count is incremented by 1 for that edge. Thus checking that the street has not already been audited is very easy.
And the reason I strongly believe that it should happen in real time is that users will want to do a mission, then immediately check to see how much of the neighborhood has been audited. It would be disheartening to do 4 missions, then look back at the choropleth and see that the percentage is the same as it was before you started auditing.
I just suspect that seeing the choropleth update will be highly motivating!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
PR #692 resolves this. |
We don't want users to be able to audit completed neighborhoods right now, so that should be disallowed when they are looking at the map in their user dashboard, and in the new choropleth.
The text was updated successfully, but these errors were encountered: