# Path: athlib/exceptions.py
# class RuleViolation(Exception):
#     """Exception to indicate incorrect athletics logic
# 
#     This may be used if, for example, there is a fourth
#     attempt at a high jump.  We use this as a form of
#     assertion within the code; others are welcome to as well.
#     """
#     pass


from decimal import Decimal
from .exceptions import RuleViolation
from typing import Tuple, List, Dict

        # list of strings containing '', 'o', 'xo', 'xxo', 'xxx', 'x', 'xx'
        self.attempts_by_height = []
        self.highest_cleared = Decimal("0.00")
        self.highest_cleared_index = -1
        self.eliminated = False     # still in the competition?
        self.dismissed = False      # still in the round?
        self.round_lim = 3
        self.consecutive_failures = 0

        for (arg, default) in [
            ('first_name', 'unknown'),
            ('last_name', 'athlete'),
            ('bib', '0'),
            ('team', 'GUEST'),
            ('gender', 'M'),  # sexist but valid
            ('category', 'OPEN'),
            ('order', 1),
        ]:
            value = kwargs.get(arg, default)
            setattr(self, arg, value)

    def _set_jump_array(self, height_count: int, label : str = 'jump') -> None:
        """Ensure they have one string for each height in the competition

        Jumpers can miss out heights.
        """
        assert height_count > 0, "Start at height number 1, not 0"
        if self.eliminated or self.dismissed:
            what = 'retiring' if self.has_retired else 'being eliminated' if self.eliminated else 'passing'

# Path: athlib/exceptions.py
# class RuleViolation(Exception):
#     """Exception to indicate incorrect athletics logic
# 
#     This may be used if, for example, there is a fourth
#     attempt at a high jump.  We use this as a form of
#     assertion within the code; others are welcome to as well.
#     """
#     pass


# Path: athlib/highjump.py
from decimal import Decimal
from .exceptions import RuleViolation
from typing import Tuple, List, Dict


        # list of strings containing '', 'o', 'xo', 'xxo', 'xxx', 'x', 'xx'
        self.attempts_by_height = []
        self.highest_cleared = Decimal("0.00")
        self.highest_cleared_index = -1
        self.eliminated = False     # still in the competition?
        self.dismissed = False      # still in the round?
        self.round_lim = 3
        self.consecutive_failures = 0

        for (arg, default) in [
            ('first_name', 'unknown'),
            ('last_name', 'athlete'),
            ('bib', '0'),
            ('team', 'GUEST'),
            ('gender', 'M'),  # sexist but valid
            ('category', 'OPEN'),
            ('order', 1),
        ]:
            value = kwargs.get(arg, default)
            setattr(self, arg, value)

    def _set_jump_array(self, height_count: int, label : str = 'jump') -> None:
        """Ensure they have one string for each height in the competition

        Jumpers can miss out heights.
        """
        assert height_count > 0, "Start at height number 1, not 0"
        if self.eliminated or self.dismissed:
            what = 'retiring' if self.has_retired else 'being eliminated' if self.eliminated else 'passing'

            raise RuleViolation("Cannot %s after %s" % (label,what))