MatchConfiguration

The MatchConfiguration dataclass groups together all scoring formats, rules, starting server rotations, and other parameters that define the conditions of a padel match. This class is passed to Match or MatchScoreHistory to establish rules like Golden Point (Punto de Oro), Mini Sets, or Match Deciding Super Tie-breaks.

Properties

  • Name
    best_of_sets
    Type
    int
    Description

    The maximum number of sets to be played in the match (default is 3 for best-of-three, but can also be configured to 5).

  • Name
    advantage_method
    Type
    Literal['advantage', 'gold_point']
    Description

    The method used to break a deuce (40-40) tie in games. Use 'advantage' for traditional advantages, or 'gold_point' for the FIP-official deciding gold point (Punto de Oro).

  • Name
    set_format
    Type
    Literal['standard', 'mini']
    Description

    The structure of each regular set. 'standard' sets are won by reaching 6 games (with a margin of 2, or a tie-break at 6-6). 'mini' sets are played to 4 games (with a tie-break at 4-4).

  • Name
    deciding_set_format
    Type
    Literal['regular', 'tiebreak', 'super_tiebreak']
    Description

    The format of the final set if a tie occurs (e.g. at 1-1 in a best-of-three match). Use 'regular' for a full set, 'tiebreak' for a match-deciding 7-point tie-break, or 'super_tiebreak' for a 10-point super tie-break.

  • Name
    starting_server_team
    Type
    TeamId
    Description

    The TeamId who will start serving on the very first point of the match. Defaults to TeamId.A.

  • Name
    set_starting_servers
    Type
    dict[int, dict[TeamId, Player]]
    Description

    A dictionary mapping 1-indexed set indices to their starting servers for each team. Allows declaring serving rosters for each set dynamically.


Initialization

Creates a new instance of a MatchConfiguration.

Note: PadelKit validates configurations early on both initialization and dynamically on dynamic updates, raising a ValueError for invalid parameters (e.g. non-positive or even best_of_sets, invalid format option strings, or incorrect types).

Keyword Arguments

  • Name
    best_of_sets
    Type
    int
    Description

    Number of sets to play (usually 3 or 5).

  • Name
    advantage_method
    Type
    str
    Description

    Deuce-breaking format: 'advantage' or 'gold_point'.

  • Name
    set_format
    Type
    str
    Description

    Set length: 'standard' (to 6 games) or 'mini' (to 4 games).

  • Name
    deciding_set_format
    Type
    str
    Description

    Deciding final set behavior: 'regular', 'tiebreak' or 'super_tiebreak'.

  • Name
    starting_server_team
    Type
    TeamId
    Description

    The starting server team on point 1 of set 1.

  • Name
    set_starting_servers
    Type
    dict[int, dict[TeamId, Player]]
    Description

    Starting serving players dictionary by set index and team.

Instantiation

class
MatchConfiguration
from padelkit import MatchConfiguration, TeamId, Player

p1 = Player(name="Coello")
p3 = Player(name="Galán")

config = MatchConfiguration(
    best_of_sets=3,
    advantage_method="gold_point",
    set_format="standard",
    deciding_set_format="super_tiebreak",
    starting_server_team=TeamId.A,
    set_starting_servers={
        1: {
            TeamId.A: p1,
            TeamId.B: p3
        }
    }
)

Output structure

MatchConfiguration(
  best_of_sets=3,
  advantage_method='gold_point',
  set_format='standard',
  deciding_set_format='super_tiebreak',
  starting_server_team=<TeamId.A: 'A'>,
  set_starting_servers={1: {<TeamId.A: 'A'>: Player(name='Coello'), ...}}
)

Was this page helpful?