toucan.mvp.calculator.discipline#

Module defining the disciplines ran in the Toucan Tournament and auxiliary methods.

Classes#

ToucanDiscipline

Provides an enum holding the different disciplines available.

Functions#

get_discipline_by_name(→ ToucanDiscipline)

Return the ToucanDiscipline enum class corresponding to a given name.

Module Contents#

class toucan.mvp.calculator.discipline.ToucanDiscipline(*args, **kwds)#

Bases: enum.Enum

Provides an enum holding the different disciplines available.

Notes

The pattern on how to process each line of the files for each discipline match is stored here. The values in each enum are as follows:

  1. Enum ID.

  2. Regex for processing each player’s contribution in a match. Assumed conditions:

    • Name, nickname and team name can be anything.

    • Match statistics (scores, rebounds etc.) MUST be a number.

    • Player number MUST be a number.

    • Player position MUST be a letter.

  3. Dictionary containing the “evaluation” as a function of the position.

  4. Location in which the points are stored inside the evaluation and whether the points contributed are considered as an addition or subtraction (e.g. goal made or goal received).

  5. Extra rating points (e.g. initial).

BASKETBALL#
HANDBALL#
get_pattern() str#

Accessor method to the line pattern in a match file.

Returns:
str

The regex expression for a match line.

get_eval_params() Dict[str, Tuple[int]]#

Accessor method to the evaluation parameters for a player in a match file.

Returns:
Dict[str, Tuple[int]]

Dictionary containing the evaluation parameters as a function of the position.

get_points_in_eval_params() Tuple[Tuple[int, bool]]#

Accessor method to the positions in the evaluation parameters.

Returns:
Tuple[Tuple[int, bool]]

Tuple of tuples, where each subtuple indicates the location where points are contributed and whether they should be considered as an addition to the team’s score os a subtraction.

get_extra_points() Dict[str, int]#

Accessor method to the extra rating points for a player in a match file.

Returns:
Dict[str, int]

Dictionary containing the extra rating points as a function of the position.

toucan.mvp.calculator.discipline.get_discipline_by_name(name: str) ToucanDiscipline#

Return the ToucanDiscipline enum class corresponding to a given name.

Parameters:
namestr

The name of the discipline.

Returns:
ToucanDiscipline

The ToucanDiscipline enum.