Skip to content

Commit

Permalink
Support "Inactive Ballots"
Browse files Browse the repository at this point in the history
  • Loading branch information
artoonie committed Jun 27, 2023
1 parent 0eb5426 commit a76eb6e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion rcvformats/conversions/ut_without_transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ def _get_elected_names(cls, rounds, round_i):
def _convert_tally_string_to_decimal(cls, rounds):
for round_data in rounds:
for person in round_data['tally']:
round_data['tally'][person] = float(round_data['tally'][person])
tally_non_float = round_data['tally'][person]
if tally_non_float is None:
if person == "Inactive Ballots":
tally_non_float = 0
else:
raise ValueError("Must have values for every candidate")
round_data['tally'][person] = float(tally_non_float)

def _fill_in_tallyresults(self, rounds):
""" Fill out rounds['tallyResults'] based on rounds['tally'] """
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nose-py3==1.6.2
pylint==2.17.4
autopep8==1.5.7
autopep8==2.0.2
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jsonschema==3.2.0
openpyxl==3.0.9
jsonschema==4.17.3
openpyxl==3.1.2
defusedxml==0.7.1
Binary file added testdata/inputs/dominion_xlsx/v5_17_multi.xlsx
Binary file not shown.
File renamed without changes.

0 comments on commit a76eb6e

Please sign in to comment.