Skip to content
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

Manual Tally Policy - CSV Tally Reports #4074

Merged
merged 8 commits into from
Oct 23, 2023
Merged

Conversation

adghayes
Copy link
Collaborator

@adghayes adghayes commented Oct 11, 2023

review by commit, there's a refactor and bug fix in the log

Overview

Closes #4069 alongside #4073. Updates the tally CSV exports so that they split manual and scanned results.

Demo Video or Screenshot

N/A, example file attached:
TEST-full-election-tally-report__2023-10-23_13-11-49.csv

Testing Plan

Automated testing.

Checklist

  • I have added logging where appropriate to any new user actions, system updates such as file reads or storage writes, or errors introduced.
  • I have added a screenshot and/or video to this PR to demo the change
  • I have added the "user_facing_change" label to this PR to automate an announcement in #machine-product-updates

@adghayes adghayes force-pushed the drew/manual-ballot-counts-policy branch from d7996c7 to bb5557c Compare October 13, 2023 06:50
@adghayes adghayes changed the base branch from drew/manual-ballot-counts-policy to main October 13, 2023 14:16
@adghayes adghayes force-pushed the drew/manual-tally-policy branch from 6dd3f97 to bf5e3a2 Compare October 23, 2023 19:06
@adghayes adghayes force-pushed the drew/manual-tally-policy branch from ad465cc to 592f43f Compare October 23, 2023 19:36
Comment on lines -544 to +546
combinedContestResults.tallies[candidateTally.id] = candidateTally;
combinedContestResults.tallies[candidateTally.id] = {
...candidateTally,
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

Comment on lines +58 to +66
export function getTallyReportCandidateRows({
contest,
scannedContestResults,
manualContestResults,
}: {
contest: CandidateContest;
scannedContestResults: Tabulation.CandidateContestResults;
manualContestResults?: Tabulation.CandidateContestResults;
}): TallyReportCandidateRow[] {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that for the use case in this PR, this is a little overbuilt. But. I'm breaking this logic out into a util because I will use the same logic for frontend tally reports, and add different algorithms for grouping / showing write-in candidates. Either "show all", or "show significant." Future features, like the ability to have official write-in candidates, could add more algorithms here. Will build on this in next PR.

Comment on lines -145 to -149
export const writeInCandidate: Candidate = {
id: 'write-in',
name: 'Write-In',
isWriteIn: true,
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not strictly necessary, I thought it was better to keep this under tabulation rather than election because it really is a tabulation tool. Also, use variable naming to indicate it represents a generic or pending write-in, rather than perhaps thinking it is an actual write-in.

isWriteIn: true,
};

export const PENDING_WRITE_IN_ID = GENERIC_WRITE_IN_ID;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am leaving these two with the same IDs because they should never exist in a list together, and changing IDs risked breaking something. But I separated out PENDING from GENERIC to give them different default names, and to make code using them more readable.

if (hasManualResults) {
headers.push('Manual Votes', 'Scanned Votes');
}
headers.push('Total Votes');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's no manual results, we could just keep the column name here as "Votes." But I assume for external systems consuming our .csv files, it will be less confusing if the column names do not change.

@adghayes adghayes marked this pull request as ready for review October 23, 2023 19:50
@adghayes adghayes requested review from carolinemodic and a team as code owners October 23, 2023 19:50
@adghayes adghayes requested review from jonahkagan and kofi-q and removed request for a team, carolinemodic and jonahkagan October 23, 2023 19:50
@adghayes adghayes merged commit 75f9f11 into main Oct 23, 2023
@adghayes adghayes deleted the drew/manual-tally-policy branch October 23, 2023 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VxAdmin Reports: Standardize Manual Counts Policy
2 participants