Rename base WIG/UIG classes

This commit is contained in:
RunasSudo 2020-12-27 18:57:36 +11:00
parent 81dbadb8ae
commit 8307ebf86c
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
4 changed files with 9 additions and 9 deletions

View File

@ -42,11 +42,11 @@ onmessage = function(evt) {
// Create counter
let counter;
if (evt.data.transfers === 'uig') {
counter = py.pyRCV2.method.base_stv.BaseUIGSTVCounter(election, evt.data.options);
counter = py.pyRCV2.method.base_stv.UIGSTVCounter(election, evt.data.options);
} else if (evt.data.transfers === 'wright') {
counter = py.pyRCV2.method.wright.WrightSTVCounter(election, evt.data.options);
} else {
counter = py.pyRCV2.method.base_stv.BaseWIGSTVCounter(election, evt.data.options);
counter = py.pyRCV2.method.base_stv.WIGSTVCounter(election, evt.data.options);
}
if (evt.data.options['ties'] === 'backwards_random') {

View File

@ -18,7 +18,7 @@ import pyRCV2.blt
import pyRCV2.model
import pyRCV2.numbers
from pyRCV2.method.base_stv import BaseUIGSTVCounter, BaseWIGSTVCounter
from pyRCV2.method.base_stv import UIGSTVCounter, WIGSTVCounter
from pyRCV2.method.wright import WrightSTVCounter
from pyRCV2.ties import TiesBackwards, TiesPrompt, TiesRandom
@ -80,11 +80,11 @@ def main(args):
# Create counter
if args.method == 'uig':
counter = BaseUIGSTVCounter(election, vars(args))
counter = UIGSTVCounter(election, vars(args))
elif args.method == 'wright':
counter = WrightSTVCounter(election, vars(args))
else:
counter = BaseWIGSTVCounter(election, vars(args))
counter = WIGSTVCounter(election, vars(args))
if args.ties is None:
args.ties = ['backwards', 'random']

View File

@ -425,7 +425,7 @@ class BaseSTVCounter:
raise Exception('Unable to resolve tie')
class BaseWIGSTVCounter(BaseSTVCounter):
class WIGSTVCounter(BaseSTVCounter):
"""
Basic weighted inclusive Gregory STV counter
"""
@ -458,7 +458,7 @@ class BaseWIGSTVCounter(BaseSTVCounter):
self.exhausted.ballots.append((ballot, ballot_value))
__pragma__('noopov')
class BaseUIGSTVCounter(BaseSTVCounter):
class UIGSTVCounter(BaseSTVCounter):
"""
Basic unweighted inclusive Gregory STV counter
"""

View File

@ -14,11 +14,11 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from pyRCV2.method.base_stv import BaseWIGSTVCounter
from pyRCV2.method.base_stv import WIGSTVCounter
from pyRCV2.model import CandidateState, CountCard
from pyRCV2.safedict import SafeDict
class WrightSTVCounter(BaseWIGSTVCounter):
class WrightSTVCounter(WIGSTVCounter):
"""
Wright STV implementation
"""