Elimination

class whalrus.Elimination(*args, **kwargs)[source]

An elimination method.

An Elimination object is a callable whose input is a Rule (which has already loaded a profile). When the Elimination object is called, it loads the rule. The output of the call is the Elimination object itself. But after the call, you can access to the computed variables (ending with an underscore), such as eliminated_order_, eliminated_ or qualified_.

Parameters
  • args – If present, these parameters will be passed to __call__ immediately after initialization.

  • kwargs – If present, these parameters will be passed to __call__ immediately after initialization.

rule_

This attribute stores the rule given in argument of the __call__.

Type

Rule

Examples

Cf. EliminationLast for some examples.

property eliminated_

The eliminated candidates.

This should always be non-empty. It may contain all the candidates (for example, it is always the case when there was only one candidate in the election).

Type

NiceSet

property eliminated_order_

The order on the eliminated candidates.

It is a list where each element is a NiceSet. Each set represents a class of tied candidates. The first set in the list represents the “best” eliminated candidates, whereas the last set represent the “worst” candidates.

Type

list

property qualified_

The candidates that are qualified (not eliminated).

Type

NiceSet