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
UI and config updates for Stop Tabulation Early #636
Conversation
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.
I can look more closely at your code later, but some initial responses:
Style. Is there an automatic linter or styleguide?
Yes, please use Checkstyle. (The config is under config/checkstyle
. Not sure about other IDEs, but it integrates well with IntelliJ.)
Config. I followed the paradigm of a specific keyword to specify "max" in the config, which translates to checkboxes in the UI. Is that reasonable?
I would prefer to match the UI we use for other optional fields: we just have a single text box, and the user leaves it blank (which corresponds to null internally) if they don't want to specify it.
Bumping version to update config -- any unforeseen issues there?
I don't believe so...? Hylton might remember something.
Btw, unrelated to your PR, but while looking at your screenshot I noticed that we have an asterisk next to "Random seed." This is inaccurate: that field is only required if the config selects one of the random tie-break modes. You might as well fix it while you're here.
f51e0cb
to
35f2a5c
Compare
Thank you -- that all makes sense. Updated the main post with the new UI. What do you use to edit the .fxml files? I'm using SceneBuilder but it changes the formatting and creates a too-large diff. For these commits I'm manually editing the files. PS I prefer force-pushes + clean commit history, but force pushing dirties Pull Requests. LMK if you favor additional commits over force-pushes, or if you prefer me to push less frequently. |
b58ce76
to
59e8eb2
Compare
59e8eb2
to
b2e92b0
Compare
src/main/resources/network/brightspots/rcv/hints_winning_rules.txt
Outdated
Show resolved
Hide resolved
34a0c85
to
d7e79c7
Compare
.../brightspots/rcv/test_data/stop_tabulation_early_test/stop_tabulation_early_test_config.json
Show resolved
Hide resolved
}, | ||
"tallyResults" : [ { | ||
"eliminated" : "George Gervin", | ||
"transfers" : { } |
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.
Reading the legislation, having no transfers on this round seems correct. Let me know if anybody disagrees. (It doesn't make sense to add in last-round transfers to me, but I did want to flag just in case.)
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.
Not sure how to answer this. @tarheel?
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.
I'm inclined to agree, since transfers would only be relevant if you were going to then proceed and show the tallies for the next round. But @chughes297 and @rrojas350 may have an opinion.
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.
I agree, you'd only show the results of the surplus transfer in the next round.
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.
Great first PR!
}, | ||
"tallyResults" : [ { | ||
"eliminated" : "George Gervin", | ||
"transfers" : { } |
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.
Not sure how to answer this. @tarheel?
.../brightspots/rcv/test_data/stop_tabulation_early_test/stop_tabulation_early_test_config.json
Show resolved
Hide resolved
src/main/resources/network/brightspots/rcv/hints_winning_rules.txt
Outdated
Show resolved
Hide resolved
@@ -947,6 +962,12 @@ boolean isContinueUntilTwoCandidatesRemainEnabled() { | |||
return rawConfig.rules.continueUntilTwoCandidatesRemain; | |||
} | |||
|
|||
Integer getStopTabulationAtRound() { |
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.
Nit: getStopTabulationEarlyOnRound
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.
This still says "at" instead of "on", so recommend changing it to be consistent with everything else.
@tarheel I believe this is correct actually, and would argue we should leave it as-is. We don't dynamically generate these asterisks, so it looks like they're used whenever something is required in certain cases as well.
Yeah, this sucks. I sometimes use SceneBuilder in IntelliJ to get a basic wireframe in place (or if I'm confused about how to add a particular element), but then I'll go back into the code, copy the main chunk it added, revert the file, then paste it in and manually tweak it until it looks good.
We do squash commits on our PRs, so I think that means either way would be fine? |
Thanks for the review! All changes made. |
FYI this was already merged: #637 |
98444aa
to
81f4b74
Compare
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.
Great work on this! Just one more nit I suggest fixing and then I think you're good to merge.
Yes, please revert, per #637 (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.
I added a few inline thoughts.
One bigger question (and apologies for not thinking of this earlier): does this actually satisfy the requirement from the legislation?
"The voting system must allow the user to decide whether to pause the tabulation session after each round or to continue until a winner is determined or a manual tie break for elimination is required."
To me, that sounds like we actually want a boolean setting for this -- and when it's enabled, the tabulator stops after every round and lets the user decide whether to proceed.
cc @chughes297 and @rrojas350 for this question also.
if (fieldOutOfRangeOrNotInteger( | ||
getStopTabulationEarlyOnRoundRaw(), | ||
"stopEarlyOnRound", | ||
MIN_NUMBER_OF_ROUNDS, |
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.
Shouldn't this be 1? If they say to stop after 0 rounds, that's the same as just not running the tabulation at all, isn't it?
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.
Yes, I figured that might be useful in some cases -- you'd still get the output files with zero rounds (similar to running a Zero Report?). I can change it to 1
though if you prefer.
@@ -412,7 +412,9 @@ private boolean shouldContinueTabulating() { | |||
int numEliminatedCandidates = candidateToRoundEliminated.size(); | |||
int numWinnersDeclared = winnerToRound.size(); | |||
// apply config setting if specified |
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.
let's just delete this comment; it's ambiguous and doesn't add anything anyway
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.
Can do. (Note: It wasn't part of this PR.)
@@ -789,6 +799,10 @@ private String getNumberOfWinnersRaw() { | |||
return rawConfig.rules.numberOfWinners; | |||
} | |||
|
|||
private String getStopTabulationEarlyOnRoundRaw() { |
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.
If I'm not mistaken, this setting means that we'd stop after the specified number of rounds, right? If so, let's call it that instead to make it more clear. Stop on a round makes it sound like maybe we're stopping at the beginning of that round.
}, | ||
"tallyResults" : [ { | ||
"eliminated" : "George Gervin", | ||
"transfers" : { } |
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.
I'm inclined to agree, since transfers would only be relevant if you were going to then proceed and show the tallies for the next round. But @chughes297 and @rrojas350 may have an opinion.
#648 addresses all the comments here |
Pause gives me some pause. I hadn't thought of it that way until you mentioned it Louis and I believe a boolean setting would be better here. However, so long as we can stop after a round and produce results, I think we still fall within the law here, even if the admin would have to rerun with the tabulation. |
Sorry to have missed earlier conversations here, but I don't see a use case for telling tabulation to stop at a specific round of counting. Like Louis, I read the law as requiring software that can be told to stop after each round of counting, not to stop at an arbitrary round of counting. When I read the requirement I think of something like what Alaska did for their Nov 2022 results livestream. That seems to require far more than just what is being considered in this issue though. |
Let me know if this needs to be reworked. For now, what Rene said seems to meet the requirements:
|
I think the other way would be preferable for sure, but if folks think that the implementation here is technically sufficient, maybe we make the revised approach a P1 or P2 for this release. |
I reached out to the CO SOS's office to get their opinion on this item but for now we can hold off on making any further changes. We may revisit this item in v1.5, depending on their feedback and requirements but as far as 1.4, we're good. |
No logic changes to tabulation yet, just UI + configuration changes.
Being my first Pull Request with a substantial feature, I'm asking for a more detailed review than I'd likely need in the future. I've called out specific decisions throughout the code that I'd like feedback on.
If all looks good, I believe this is ready to merge.