sol.models.rating – Ratings

class sol.models.rating.Rating(**kwargs)

A particular rating a tournament can be related to.

default_deviation

Default value of deviation (PHI) for the Glicko2 algorithm.

default_rate

Default value of rate (MU) for the Glicko2 algorithm.

default_volatility

Default value of volatility (SIGMA) for the Glicko2 algorithm.

description

Description of the rating.

getPlayerRating(player, before=None)

Return the rate of a player

Parameters:
  • player – a Player instance
  • before – a date instance
Return type:

an instance of glicko2.Rating

If before is not specified fetch the latest rate, otherwise the most recent one preceeding before.

The method considers the referenced rating as well as all those with an higher level.

higher_rate

Higher value of the range used to interpolate players rates.

idowner

ID of the user that is responsible of this record.

idrating

Primary key.

inherit

Whether to lookup rates in equal or higher levels ratings.

isPhantom(competitor)

Determine whether the given competitor is actually a Phantom.

Parameters:competitor – a Competitor instance

This is needed because someone use a concrete player as Phantom, to customize its name (not everybody have a good sense of humor...)

level

Rating level.

lower_rate

Lower value of the range used to interpolate players rates when (almost) all competitors are unrated.

outcomes

Kind of formula used to compute match outcomes.

This is used to determine which formula will be used to compute the match outcomes to feed Glicko2 algorithm. It may be:

glicko2
standard Glicko, giving 1.0 to the winner and 0.0 to the loser, 0.5 in case of draw, developed with Chess in mind;
guido
Guido’s variant, better suited to Carrom: basically each player is assigned a fraction of his own score divided by the sum of the scores of both players;
expds
an exponential formula applied to the two concurrents final scores difference.
owner

The owner of this record, admin when None.

ranking

Players sorted by their latest rate.

Return type:sequence
Returns:a sorted list of tuples containing the player, its latest rate, deviation and volatility, and the number of rates in this rating.
rates

List of rates.

recompute(mindate=None, scratch=False)

Recompute the whole rating.

Parameters:
  • mindate – either None or a date
  • scratch – a boolean, True to recompute from scratch

If mindate is given, recompute the rating ignoring the tourneys before that date.

serialize(serializer)

Reduce a single rating to a simple dictionary.

Parameters:serializer – a sol.models.bio.Serializer instance
Return type:dict
Returns:a plain dictionary containing a flatified view of this rating
tau

Value of TAU for the Glicko2 algorithm.

time_span

Return the time span of this rating.

tourneys

Tourneys using this rating.

Previous topic

sol.models.rate – Player rates

Next topic

sol.models.tourney – Tournaments

This Page