-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add InterceptionEvent #230
Add InterceptionEvent #230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only added two suggestions. Apart from these it seems ok to me. Thanks for implementing this!
Note that I did not check the Wyscout v3 implementation in detail since I am not familiar with that data.
@@ -761,6 +792,14 @@ def deserialize(self, inputs: OptaInputs) -> EventDataset: | |||
**duel_event_kwargs, | |||
**generic_event_kwargs, | |||
) | |||
elif type_id == EVENT_TYPE_INTERCEPTION: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opta also has a "blocked pass" event. Would it make sense to parse it as an interception too?
blocked pass := When a player tries to cut out an opposition pass by any means. Similar to an interception except there is much less reading of the pass.
@@ -477,6 +510,24 @@ def deserialize(self, inputs: WyscoutInputs) -> EventDataset: | |||
**generic_event_args, | |||
) | |||
|
|||
# If also an interception event, add this before other event (It is a tag on multiple wyscout_events) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wyscout does not have a separate event type for interceptions. Instead, interceptions are recorded as a pass, duel or touch event with an "interception" tag. Your current implementation works well for passes, but for consistency with other providers (and socceraction) I would convert these duels/touch events to an interception. Not to an interception + duel.
…el as interception.
Addition:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request looks good to me. Thanks!
@MKlaasman thanks for your work. Can you please merge master in? There are some small merge conflicts due to changes from Pieters PRs. |
# Conflicts: # kloppy/infra/serializers/event/statsbomb/deserializer.py # kloppy/tests/test_helpers.py # kloppy/tests/test_state_builder.py # kloppy/tests/test_statsbomb.py # kloppy/tests/test_to_records.py
fixes #222
Notes:
What do you think? @probberechts @JanVanHaaren