From 81dbadb8aec313fed7856d3d4f96c2842ede1ada Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 27 Dec 2020 18:55:29 +1100 Subject: [PATCH] Fix error/bug in unweighted inclusive Gregory implementation --- pyRCV2/method/base_stv.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyRCV2/method/base_stv.py b/pyRCV2/method/base_stv.py index 9ef7485..91b3e39 100644 --- a/pyRCV2/method/base_stv.py +++ b/pyRCV2/method/base_stv.py @@ -463,10 +463,11 @@ class BaseUIGSTVCounter(BaseSTVCounter): Basic unweighted inclusive Gregory STV counter """ - def __init__(self, *args, **kwargs): - BaseSTVCounter.__init__(self, *args, **kwargs) + def __init__(self, *args): + BaseSTVCounter.__init__(self, *args) # Need to use Rational for ballot value internally, as Num may be set to integers only - self.cls_ballot_value = Rational + #self.cls_ballot_value = Rational + self.cls_ballot_value = lambda x: x.to_rational() def do_surplus(self, candidate_surplus, count_card, surplus): # FIXME: Is it okay to use native int's here?