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
deprecate the concept of "codes" (almost) entirely #690
Conversation
0655785
to
e4d1ef3
Compare
e4d1ef3
to
79ca6cc
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.
Please review the commit I added to clean up a bit more and make sure it looks good to you.
13,18,504,4,,PCT 7348,27,28,undervote,undervote | ||
13,19,664,45,,PCT 7326,27,28,29,30 | ||
13,19,664,67,,PCT 7321,28,29,30,undervote | ||
Contest Id,Tabulator Id,Batch Id,Record Id,Precinct,Precinct Portion,Rank 1,Rank 2,Rank 3,Rank 4 |
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.
On the topic of tests, does testPortlandMayorCodes
need to be updated somehow as well?
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 don't think so -- it still verifies that the codes work as intended.
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.
Heads-up that #642 will swap these over to aliases
whether we like it or not. I can make a note in there to keep it as-is if we care about testing old file formats, but I don't really think we do.
@@ -1063,10 +1063,6 @@ String getNameForCandidate(String nameOrAlias) { | |||
return candidateAliasesToNameMap.get(nameOrAlias); | |||
} | |||
|
|||
String getCodeForCandidate(String nameOrAlias) { |
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.
In this comment, you mentioned possibly reverting / getting rid of some lines in TabulatorSession
. Is that no longer feasible?
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 pushed a commit showing the effect of that. Depends on what we want -- we can get rid of getNameForCandidate
in ResultsWriter
, which generates results that use the candidate code instead of the candidate name. See the diff here.
I'm not sure how the _expected.csv
s are used, so I don't know which format is more useful, but it seems likely that it's more useful with canonical names (i.e. reverting #3f121b7, the next commit) and keeping the code as it was.
Let me know which you prefer.
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.
The _expected.csv
s are just used for our tests.
Hard for me to answer this question... might be best for @tarheel or @chughes297 to weigh in? It appears that with the above commit you linked, it leaves our tests as-is, which is probably preferred?
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 the outputted CSVs never used by election administrators? If so, then I suppose it doesn't matter.
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.
The real output CSV are definitely used by admins. @HEdingfield is just referring specifically to the _expected.csv
files that are in the test directories.
Apologies if I missed a relevant part of the discussion -- I'm just looking at this comment thread -- but I think ideally the output CSV would have the canonical names in one column and then perhaps a separate column that lists any alias that are used for each candidate (separated by a delimiter).
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. I think that makes sense too. I reverted the last commit, and this PR should be ready to go now.
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.
Hm-- let's separate adding both canonical names and aliases for another task?
@chughes297 @tarheel do y'all think it's worth creating a new issue for this? If so, is it something we'd need to include in 1.4.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.
Yes, I think it would be useful to list aliases in the output spreadsheet. I doubt it's a requirement for v1.4, but @chughes297 can 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.
Yes let's create a separate issue but not a huge priority for me to include in 1.4.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.
Created #705 for this.
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.
LGTM!
resolves #663
This removes the concept of "codes" entirely. In doing so, all dominion tests have been updated to use candidate names instead of codes.
In order to ensure that the tests were only changed for exactly what we expect, I didn't simply replace test files with their updated version; I used the script below to update each test. It's not documented because it's a one-time throwaway, but let me know if you have questions on it: