Skip to content

Commit

Permalink
fix player pattern type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
DriesDeprest committed Mar 14, 2024
1 parent 5c297ce commit 717e769
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions kloppy/infra/serializers/event/statsbomb/specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class BODYPART(Enum, metaclass=TypesEnumMeta):
class PLAY_PATTERN(Enum, metaclass=TypesEnumMeta):
"""The list of play patterns used in StatsBomb data."""

REGULAR_PLAYER = 1
REGULAR_PLAY = 1
FROM_CORNER = 2
FROM_FREE_KICK = 3
FROM_THROW_IN = 4
Expand Down Expand Up @@ -335,10 +335,8 @@ def _create_events(
return [generic_event]

def _add_play_pattern_qualifiers(self, event: Event) -> Event:
if (
self.raw_event["play_pattern"]["id"]
== PLAY_PATTERN.FROM_COUNTER.value
):
pattern_id = PLAY_PATTERN(self.raw_event["play_pattern"]["id"])
if pattern_id == PLAY_PATTERN.FROM_COUNTER:
if event.qualifiers:
event.qualifiers.append(CounterAttackQualifier(True))
else:
Expand Down

0 comments on commit 717e769

Please sign in to comment.