From fa1864146262489313f50ec8f60e2ff1f2a8206d Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sat, 17 Oct 2020 23:09:29 +1100 Subject: [PATCH] Cosmetic improvements --- pyRCV2/method/STVCCounter.py | 8 ++++---- test.html | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyRCV2/method/STVCCounter.py b/pyRCV2/method/STVCCounter.py index c77e722..2a83929 100644 --- a/pyRCV2/method/STVCCounter.py +++ b/pyRCV2/method/STVCCounter.py @@ -91,7 +91,7 @@ class STVCCounter: if len(has_surplus) > 0: # Distribute surpluses in order of size has_surplus.sort(lambda x: x[1].votes, True) - candidate, count_card = has_surplus[0] + candidate_surplus, count_card = has_surplus[0] count_card.state = CandidateState.ELECTED __pragma__('opov') @@ -119,7 +119,7 @@ class STVCCounter: self.elect_meeting_quota() return CountStepResult( - 'Surplus', + 'Surplus of ' + candidate_surplus.name, self.candidates, self.exhausted, self.quota @@ -131,7 +131,7 @@ class STVCCounter: hopefuls.sort(lambda x: x[1].votes) # TODO: Handle ties - candidate, count_card = hopefuls[0] + candidate_excluded, count_card = hopefuls[0] count_card.state = CandidateState.EXCLUDED __pragma__('opov') count_card.transfers -= count_card.votes @@ -155,7 +155,7 @@ class STVCCounter: self.elect_meeting_quota() return CountStepResult( - 'Exclusion', + 'Exclusion of ' + candidate_excluded.name, self.candidates, self.exhausted, self.quota diff --git a/test.html b/test.html index 44c7f9b..fcd7e18 100644 --- a/test.html +++ b/test.html @@ -38,6 +38,7 @@ // Initialise table rows let tblResults = document.getElementById('result'); + tblResults.innerHTML = ''; let candMap = new Map(); // Map Candidate -> rows // Comment row