|
2 | 2 | import itertools |
3 | 3 | import math |
4 | 4 | from functools import reduce |
5 | | -from typing import Optional, Union, List |
| 5 | +from typing import List, Optional, Union |
6 | 6 |
|
7 | | -from openskill.constants import mu as default_mu, beta, Constants |
| 7 | +from openskill.constants import Constants, beta |
| 8 | +from openskill.constants import mu as default_mu |
8 | 9 | from openskill.constants import sigma as default_sigma |
9 | 10 | from openskill.models.plackett_luce import PlackettLuce |
10 | 11 | from openskill.statistics import phi_major, phi_major_inverse |
11 | | -from openskill.util import unwind, rankings |
| 12 | +from openskill.util import rankings, unwind |
12 | 13 |
|
13 | 14 |
|
14 | 15 | class Rating: |
@@ -262,13 +263,12 @@ def rate(teams: List[List[Rating]], **options) -> List[List[Rating]]: |
262 | 263 | :param prevent_sigma_increase: A :class:`~bool` that prevents sigma from ever increasing. |
263 | 264 | :param options: Pass in a set of custom values for constants defined in the Weng-Lin paper. |
264 | 265 | :return: Returns a list of :class:`~openskill.rate.Rating` objects. |
265 | | -
|
266 | | - .. note:: |
267 | | - ``tau`` will default to ``25/300`` in the next major version update. |
268 | 266 | """ |
| 267 | + constants = Constants(**options) |
| 268 | + tau = constants.TAU |
269 | 269 | original_teams = copy.deepcopy(teams) |
270 | 270 | if "tau" in options: |
271 | | - tau_squared = options["tau"] * options["tau"] |
| 271 | + tau_squared = tau * tau |
272 | 272 | for team_index, team in enumerate(teams): |
273 | 273 | for player_index, player in enumerate(team): |
274 | 274 | teams[team_index][player_index].sigma = math.sqrt( |
|
0 commit comments