I-Schulze Results
Abstract class used to create a schulze results object instance for schulze polls.
ISchulzeResults
Bases: abc.ABC
The expected schema for Schulze voting results. It provides a method to calculate the results + some information getters that will be used in template to render results.
It is the type expected by the Schulze results service.
Source code in apps/votes_results/classes/schulze_results/i_schulze_results.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
calculate()
abstractmethod
Do once the calculation of the results and store all information locally (so you avoid to repeat DB queries and heavy calculations)
Source code in apps/votes_results/classes/schulze_results/i_schulze_results.py
18 19 20 21 22 23 | |
get_preference_matrix_cell(a, b)
Return the number of times a is prefered to b.
Source code in apps/votes_results/classes/schulze_results/i_schulze_results.py
37 38 39 40 41 42 43 44 45 46 47 48 | |
get_sorted_options()
abstractmethod
The actual sorted algorithm results, from the better option to the worse. We use a list of list because there could be equal scores.
Source code in apps/votes_results/classes/schulze_results/i_schulze_results.py
30 31 32 33 34 35 | |
get_votes()
abstractmethod
Return the list of all submitted votes.
Source code in apps/votes_results/classes/schulze_results/i_schulze_results.py
25 26 27 28 | |