Skip to content

Commit 6844a0a

Browse files
committed
Bump version to 1.16.25 and fix ranking table display
Updated version to 1.16.25 in conf.py, __init__.py, and pyproject.toml. Improved ranking table output in profiles_with_ties.py to use the correct number of ranks.
1 parent df14530 commit 6844a0a

File tree

6 files changed

+51
-48
lines changed

6 files changed

+51
-48
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2+
*/.DS_Store
23

34
# Byte-compiled / optimized / DLL files
45
__pycache__/

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Wes Holliday and Eric Pacuit'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '1.16.24'
25+
release = '1.16.25'
2626
html_extra_path = ['../../axiom_tables']
2727

2828

example.ipynb

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": 6,
66
"id": "4a8a73a7",
77
"metadata": {},
88
"outputs": [],
@@ -22,58 +22,58 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 5,
25+
"execution_count": 8,
2626
"id": "2a2a4a26",
2727
"metadata": {},
2828
"outputs": [
2929
{
3030
"name": "stdout",
3131
"output_type": "stream",
3232
"text": [
33-
"+---+---+---+---+---+---+\n",
34-
"| 1 | 3 | 1 | 3 | 1 | 1 |\n",
35-
"+---+---+---+---+---+---+\n",
36-
"| 0 | 2 | 1 | 1 | 2 | 0 |\n",
37-
"| 2 | 1 | 0 | 2 | 0 | 1 |\n",
38-
"| 1 | 0 | 2 | 0 | 1 | 2 |\n",
39-
"+---+---+---+---+---+---+\n",
40-
"+---+---+---+---+---+---+\n",
41-
"| 3 | 3 | 1 | 1 | 1 | 1 |\n",
42-
"+---+---+---+---+---+---+\n",
43-
"| 2 | 1 | 0 | 1 | 2 | 0 |\n",
44-
"| 1 | 2 | 2 | 0 | 0 | 1 |\n",
45-
"| 0 | 0 | 1 | 2 | 1 | 2 |\n",
46-
"+---+---+---+---+---+---+\n",
47-
"+---+---+---+---+---+---+\n",
48-
"| 1 | 3 | 1 | 3 | 1 | 1 |\n",
49-
"+---+---+---+---+---+---+\n",
50-
"| 0 | 2 | 1 | 1 | 2 | 0 |\n",
51-
"| 2 | 1 | 0 | 2 | 0 | 1 |\n",
52-
"| 1 | 0 | 2 | 0 | 1 | 2 |\n",
53-
"+---+---+---+---+---+---+\n",
33+
"+---+---+---+---+\n",
34+
"| 2 | 3 | 2 | 3 |\n",
35+
"+---+---+---+---+\n",
36+
"| 0 | 1 | 0 | 2 |\n",
37+
"| 1 | 0 | 2 | 0 |\n",
38+
"| 2 | 2 | 1 | 1 |\n",
39+
"+---+---+---+---+\n",
40+
"+---+---+---+---+\n",
41+
"| 3 | 3 | 2 | 2 |\n",
42+
"+---+---+---+---+\n",
43+
"| 1 | 2 | 0 | 0 |\n",
44+
"| 0 | 0 | 1 | 2 |\n",
45+
"| 2 | 1 | 2 | 1 |\n",
46+
"+---+---+---+---+\n",
47+
"+---+---+---+---+\n",
48+
"| 2 | 3 | 2 | 3 |\n",
49+
"+---+---+---+---+\n",
50+
"| 0 | 1 | 0 | 2 |\n",
51+
"| 1 | 0 | 2 | 0 |\n",
52+
"| 2 | 2 | 1 | 1 |\n",
53+
"+---+---+---+---+\n",
5454
"\n",
5555
"\n",
56-
"+---+---+---+---+---+---+\n",
57-
"| 1 | 3 | 1 | 3 | 1 | 1 |\n",
58-
"+---+---+---+---+---+---+\n",
59-
"| 0 | 2 | 1 | 1 | 2 | 0 |\n",
60-
"| 2 | 1 | 0 | 2 | 0 | 1 |\n",
61-
"| 1 | 0 | 2 | 0 | 1 | 2 |\n",
62-
"+---+---+---+---+---+---+\n",
63-
"+---+---+---+---+---+---+\n",
64-
"| 3 | 3 | 1 | 1 | 1 | 1 |\n",
65-
"+---+---+---+---+---+---+\n",
66-
"| 2 | 1 | 0 | 1 | 2 | 0 |\n",
67-
"| 1 | 2 | 2 | 0 | 0 | 1 |\n",
68-
"| 0 | 0 | 1 | 2 | 1 | 2 |\n",
69-
"+---+---+---+---+---+---+\n",
70-
"+---+---+---+---+---+---+\n",
71-
"| 1 | 3 | 1 | 3 | 1 | 1 |\n",
72-
"+---+---+---+---+---+---+\n",
73-
"| 0 | 2 | 1 | 1 | 2 | 0 |\n",
74-
"| 2 | 1 | 0 | 2 | 0 | 1 |\n",
75-
"| 1 | 0 | 2 | 0 | 1 | 2 |\n",
76-
"+---+---+---+---+---+---+\n"
56+
"+---+---+---+---+\n",
57+
"| 2 | 3 | 2 | 3 |\n",
58+
"+---+---+---+---+\n",
59+
"| 0 | 1 | 0 | 2 |\n",
60+
"| 1 | 0 | 2 | 0 |\n",
61+
"| 2 | 2 | 1 | 1 |\n",
62+
"+---+---+---+---+\n",
63+
"+---+---+---+---+\n",
64+
"| 3 | 3 | 2 | 2 |\n",
65+
"+---+---+---+---+\n",
66+
"| 1 | 2 | 0 | 0 |\n",
67+
"| 0 | 0 | 1 | 2 |\n",
68+
"| 2 | 1 | 2 | 1 |\n",
69+
"+---+---+---+---+\n",
70+
"+---+---+---+---+\n",
71+
"| 2 | 3 | 2 | 3 |\n",
72+
"+---+---+---+---+\n",
73+
"| 0 | 1 | 0 | 2 |\n",
74+
"| 1 | 0 | 2 | 0 |\n",
75+
"| 2 | 2 | 1 | 1 |\n",
76+
"+---+---+---+---+\n"
7777
]
7878
}
7979
],

pref_voting/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.16.24'
1+
__version__ = '1.16.25'

pref_voting/profiles_with_ties.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ def display(
840840
_rankings = [r.normalize_ranks() or r for r in _rankings]
841841
curr_cands = curr_cands if curr_cands is not None else self.candidates
842842
cmap = cmap if cmap is not None else self.cmap
843+
844+
existing_ranks = max(max(r.ranks) for r in _rankings) if len(_rankings) > 0 else 0
843845
if order_by_counts:
844846
_rankings, rcounts = zip(*sorted(zip(_rankings, self.rcounts), key=lambda x: x[1], reverse=True))
845847
else:
@@ -857,7 +859,7 @@ def display(
857859
)
858860
for r in _rankings
859861
]
860-
for rank in self.ranks
862+
for rank in existing_ranks
861863
],
862864
rcounts,
863865
tablefmt=style,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[tool.poetry]
99
name = "pref_voting"
10-
version = "1.16.24"
10+
version = "1.16.25"
1111
description = "pref_voting is a Python package that contains tools to reason about elections and margin graphs, and implementations of voting methods."
1212
authors = ["Eric Pacuit <[email protected]>"]
1313
license = "MIT"

0 commit comments

Comments
 (0)