-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* allow missing CVR headers * disallow null candidate names * split missing header into new test * spotbugs fix * fix broken test * fix bad merge * Nit and reformatting. --------- Co-authored-by: Armin Samii <[email protected]> Co-authored-by: HEdingfield <[email protected]>
- Loading branch information
1 parent
2cf12fc
commit 9db43dc
Showing
7 changed files
with
286 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ork/brightspots/rcv/test_data/csv_missing_header_test/csv_missing_header_test_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"tabulatorVersion": "TEST", | ||
"outputSettings": { | ||
"contestName": "Missing Header CSV Test", | ||
"outputDirectory": "output", | ||
"contestDate": "2024-06-14", | ||
"contestJurisdiction": "Portland, ME", | ||
"contestOffice": "Mayor", | ||
"tabulateByPrecinct": false, | ||
"generateCdfJson": false | ||
}, | ||
"cvrFileSources": [ | ||
{ | ||
"filePath" : "csv_missing_header_test_cvr.csv", | ||
"firstVoteColumnIndex" : "2", | ||
"firstVoteRowIndex" : "2", | ||
"provider" : "genericCsv", | ||
"undeclaredWriteInLabel": "Write-In" | ||
} ], | ||
"candidates" : [ { | ||
"name" : "Lettuce", | ||
"code" : "", | ||
"excluded" : false | ||
}, { | ||
"name" : "Broccoli", | ||
"code" : "", | ||
"excluded" : false | ||
}, { | ||
"name" : "Cucumber", | ||
"code" : "", | ||
"excluded" : false | ||
}, { | ||
"name" : "Cauliflower", | ||
"code" : "", | ||
"excluded" : false | ||
} ], | ||
"rules" : { | ||
"tiebreakMode": "useCandidateOrder", | ||
"overvoteRule": "exhaustImmediately", | ||
"winnerElectionMode": "singleWinnerMajority", | ||
"randomSeed": "", | ||
"numberOfWinners": "1", | ||
"decimalPlacesForVoteArithmetic": "4", | ||
"minimumVoteThreshold": "0", | ||
"maxSkippedRanksAllowed": "1", | ||
"maxRankingsAllowed": "15", | ||
"nonIntegerWinningThreshold": false, | ||
"hareQuota": false, | ||
"batchElimination": true, | ||
"exhaustOnDuplicateCandidate": false, | ||
"rulesDescription": "Maine Rules" | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...network/brightspots/rcv/test_data/csv_missing_header_test/csv_missing_header_test_cvr.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
,Lettuce,Broccoli,Cucumber,Cauliflower,Write-In | ||
R_3QEQ85E7gV2DuyG,,2,1,, | ||
R_1ikP1jSJLdWUEKs,2,3,4,1, | ||
R_22G3akvxq7ggl01,3,5,2,1,4 | ||
R_2VsGZJKYqjDtYQ7,4,2,3,1, | ||
R_300GN9Myv0Dad3L,1,3,2,, | ||
R_21yNGL1wKB5ZCPL,4,2,5,3,1 | ||
R_2SdI8sTvnYmvnl8,4,2,1,3,5 | ||
R_2qdAEAZ9ODwFYYx,1,4,2,3, | ||
R_2f6w0fSg9GCXM9I,1,3,2,5,4 | ||
R_3UkrSZJnGxKaYW5,1,2,3,5,4 | ||
R_2rYkKGQ75Qu6Vxr,4,5,2,3,1 | ||
R_3kgFqD03AqBVVZE,3,2,1,4, | ||
R_3fYPpZQbDze9MRx,4,2,3,1, | ||
R_BD73UrqgXrIpnfr,2,3,1,4, | ||
R_2TYqj3GcBmz3FFl,4,2,1,3, | ||
R_AEB4v8Hohce2nv3,3,4,1,5,2 | ||
R_Aiy5eILJk4S5tIt,2,1,3,4, | ||
R_2xDiLvKgBaIxeFv,2,3,4,5,1 | ||
R_124lgkhlQv9Ullj,5,4,3,2,1 | ||
R_21EC0Nti8aqKdm9,5,3,2,4,1 | ||
R_1pDpfl9azbgtFrC,1,2,3,4,5 | ||
R_3EXs2zblwxj5olU,4,3,1,2, | ||
R_1I4UVe24fpZcqPY,2,4,5,3,1 | ||
R_27v7BD6blfCf7BQ,3,1,4,5,2 | ||
R_sUm5EhzNgJ9Fy7f,2,1,3,5,4 | ||
R_33dwoHsyajiIzbF,4,2,1,3, |
32 changes: 32 additions & 0 deletions
32
...tspots/rcv/test_data/csv_missing_header_test/csv_missing_header_test_expected_summary.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Contest Information | ||
Generated By,RCTab 1.3.999 | ||
CSV Format Version,1 | ||
Type of Election,Single-Winner | ||
Contest,Missing Header CSV Test | ||
Jurisdiction,"Portland, ME" | ||
Office,Mayor | ||
Date,2024-06-14 | ||
Winner(s),Cucumber | ||
Final Threshold,14 | ||
|
||
Contest Summary | ||
Number to be Elected,1 | ||
Number of Candidates,5 | ||
Total Number of Ballots,26 | ||
Number of Undervotes,0 | ||
|
||
Rounds,Round 1 Votes,% of vote,transfer,Round 2 Votes,% of vote,transfer,Round 3 Votes,% of vote,transfer,Round 4 Votes,% of vote,transfer | ||
Eliminated,Undeclared Write-ins,,,Broccoli,,,Cauliflower,,,,, | ||
Elected,,,,,,,,,,Cucumber,, | ||
Cucumber,8,30.76%,2,10,38.46%,0,10,38.46%,4,14,53.84%,0 | ||
Lettuce,5,19.23%,2,7,26.92%,3,10,38.46%,2,12,46.15%,0 | ||
Cauliflower,4,15.38%,1,5,19.23%,1,6,23.07%,-6,0,0.0%,0 | ||
Broccoli,3,11.53%,1,4,15.38%,-4,0,0.0%,0,0,0.0%,0 | ||
Undeclared Write-ins,6,23.07%,-6,0,0.0%,0,0,0.0%,0,0,0.0%,0 | ||
Active Ballots,26,,,26,,,26,,,26,, | ||
Current Round Threshold,14,,,14,,,14,,,14,, | ||
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0 | ||
Inactive Ballots by Skipped Rankings,0,,0,0,,0,0,,0,0,,0 | ||
Inactive Ballots by Exhausted Choices,0,,0,0,,0,0,,0,0,,0 | ||
Inactive Ballots by Repeated Rankings,0,,0,0,,0,0,,0,0,,0 | ||
Inactive Ballots Total,0,,0,0,,0,0,,0,0,,0 |
103 changes: 103 additions & 0 deletions
103
...spots/rcv/test_data/csv_missing_header_test/csv_missing_header_test_expected_summary.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"config" : { | ||
"contest" : "Missing Header CSV Test", | ||
"date" : "2024-06-14", | ||
"generatedBy" : "RCTab 1.3.999", | ||
"jurisdiction" : "Portland, ME", | ||
"office" : "Mayor" | ||
}, | ||
"jsonFormatVersion" : "1", | ||
"results" : [ { | ||
"inactiveBallots" : { | ||
"exhaustedChoices" : "0", | ||
"overvotes" : "0", | ||
"repeatedRankings" : "0", | ||
"skippedRankings" : "0" | ||
}, | ||
"round" : 1, | ||
"tally" : { | ||
"Broccoli" : "3", | ||
"Cauliflower" : "4", | ||
"Cucumber" : "8", | ||
"Lettuce" : "5", | ||
"Undeclared Write-ins" : "6" | ||
}, | ||
"tallyResults" : [ { | ||
"eliminated" : "Undeclared Write-ins", | ||
"transfers" : { | ||
"Broccoli" : "1", | ||
"Cauliflower" : "1", | ||
"Cucumber" : "2", | ||
"Lettuce" : "2" | ||
} | ||
} ], | ||
"threshold" : "14" | ||
}, { | ||
"inactiveBallots" : { | ||
"exhaustedChoices" : "0", | ||
"overvotes" : "0", | ||
"repeatedRankings" : "0", | ||
"skippedRankings" : "0" | ||
}, | ||
"round" : 2, | ||
"tally" : { | ||
"Broccoli" : "4", | ||
"Cauliflower" : "5", | ||
"Cucumber" : "10", | ||
"Lettuce" : "7" | ||
}, | ||
"tallyResults" : [ { | ||
"eliminated" : "Broccoli", | ||
"transfers" : { | ||
"Cauliflower" : "1", | ||
"Lettuce" : "3" | ||
} | ||
} ], | ||
"threshold" : "14" | ||
}, { | ||
"inactiveBallots" : { | ||
"exhaustedChoices" : "0", | ||
"overvotes" : "0", | ||
"repeatedRankings" : "0", | ||
"skippedRankings" : "0" | ||
}, | ||
"round" : 3, | ||
"tally" : { | ||
"Cauliflower" : "6", | ||
"Cucumber" : "10", | ||
"Lettuce" : "10" | ||
}, | ||
"tallyResults" : [ { | ||
"eliminated" : "Cauliflower", | ||
"transfers" : { | ||
"Cucumber" : "4", | ||
"Lettuce" : "2" | ||
} | ||
} ], | ||
"threshold" : "14" | ||
}, { | ||
"inactiveBallots" : { | ||
"exhaustedChoices" : "0", | ||
"overvotes" : "0", | ||
"repeatedRankings" : "0", | ||
"skippedRankings" : "0" | ||
}, | ||
"round" : 4, | ||
"tally" : { | ||
"Cucumber" : "14", | ||
"Lettuce" : "12" | ||
}, | ||
"tallyResults" : [ { | ||
"elected" : "Cucumber", | ||
"transfers" : { } | ||
} ], | ||
"threshold" : "14" | ||
} ], | ||
"summary" : { | ||
"finalThreshold" : "14", | ||
"numCandidates" : 5, | ||
"numWinners" : 1, | ||
"totalNumBallots" : "26", | ||
"undervotes" : 0 | ||
} | ||
} |