flitsr.ranking.Ranking¶
- class flitsr.ranking.Ranking(tiebrk: Tiebrk = Tiebrk.ORIG)¶
Bases:
objectA singular ranking, containing ranked
Spectrum.Entity.Methods
__init__([tiebrk])append(entity, score, exec_count)Append the given entity to the ranking, with the given score and execution count exec_count.
extend(ranks)get_rank(entity[, check_sub_group])Return the
Rankof the givenSpectrum.Entity.has_entity(entity)Return whether this
Rankingcontains the given entity.sort(reverse)Re-sort this
Rankingin-place by their scores, using theTiebrkmethod set.- append(entity: Entity, score: float, exec_count: int)¶
Append the given entity to the ranking, with the given score and execution count exec_count.
- Parameters:
entity – Spectrum.Entity: The entity to append to this
Ranking.score – float: The score of the given entity.
exec_count – int: The execution count of the given entity.
- extend(ranks: List[Rank])¶
Extend this
Rankingby adding allRankin theListranks.- Parameters:
ranks – List[Rank]: The
Listof ranks to add to thisRanking.
- get_rank(entity: Entity, check_sub_group=False) Rank¶
Return the
Rankof the givenSpectrum.Entity. If the check_sub_group option is given, try to find if the given entity is contained within another group in the ranking (either as a sub-group or as an element).- Parameters:
entity – Spectrum.Entity: The entity to return the rank for
check_sub_group – (Default value = False) Whether to check for the
ranking. (entity as a subgroup of entities in the)
- Returns:
The
Rankof the given entity.