Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed tallying for single-question

  • Loading branch information...
commit 36413f71ce16d9fa00907b8e9ecaea53ec0d9bf1 1 parent 20c68ba
Ben Adida authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 tally.py
  2. +2 −2 tallydata.py
View
4 tally.py
@@ -34,7 +34,7 @@
r_tables_xml = [base.file_in_dir(data_path, filenames.MEETING_THREE_OUT, 'Meeting Three Out') for data_path in DATA_PATHS]
r_tables_list = [data.parse_r_tables(r_tables) for r_tables in r_tables_xml]
-print "ok now tallying\n\n"
+# print "ok now tallying\n\n"
# the list of partitions, each of which is a list of the max number of answers each question allows
partition_map = election.partition_map_choices
@@ -79,7 +79,7 @@ def tally(output_stream):
%s
-""" % (election.spec.id, len(r_tables[0].rows), RESULT))
+""" % (election.spec.id, len(BALLOTS), RESULT))
if __name__ == '__main__':
tally(sys.stdout)
View
4 tallydata.py
@@ -70,7 +70,7 @@ def tally(cls, question, ballots):
bad_ballot = b
print "oy"
- print candidate_tallies
+ # print candidate_tallies
if max(candidate_tallies) >= absolute_majority:
break
@@ -79,7 +79,7 @@ def tally(cls, question, ballots):
lowest_count = min([tally for tally in candidate_tallies if tally is not None])
lowest_count_index = candidate_tallies.index(lowest_count)
eliminated.append(lowest_count_index)
- print "eliminating candidate %s with count %s" % (lowest_count_index, lowest_count)
+ #print "eliminating candidate %s with count %s" % (lowest_count_index, lowest_count)
for b in ballots:
b.go_next_choice(lowest_count_index)
Please sign in to comment.
Something went wrong with that request. Please try again.