Skip to content
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

[Wyscout v2] Bug in deserializing Offensive Duel events which are also an interception #268

Open
probberechts opened this issue Dec 27, 2023 · 0 comments

Comments

@probberechts
Copy link
Contributor

When a duel is also an interception, the Wyscout v2 deserializer deletes the last event before the interception.

if event.event_type.name == "DUEL":
# when DuelEvent is interception, we need to overwrite this and the previous DuelEvent
events = events[:-1]
event = interception_event

I guess the reasoning is that a defensive duel is always paired with an offensive duel and this would delete the offensive duel. However, it seems that the "interception" tag (1401) can also be given to the offensive duel. In that case, the wrong event will be deleted. For example, in the sequence of events below, the current implementation would delete the pass event.

{
            "eventId": 8,
            "subEventName": "Simple pass",
            "tags": [
                {
                    "id": 1802
                }
            ],
            "playerId": 36,
            "positions": [
                {
                    "y": 74,
                    "x": 30
                },
                {
                    "y": 64,
                    "x": 30
                }
            ],
            "matchId": 2058007,
            "eventName": "Pass",
            "teamId": 5629,
            "matchPeriod": "2H",
            "eventSec": 1787.213756,
            "subEventId": 85,
            "id": 261447235
        },
        {
            "eventId": 1,
            "subEventName": "Ground attacking duel",
            "tags": [
                {
                    "id": 1401
                },
                {
                    "id": 501
                },
                {
                    "id": 703
                },
                {
                    "id": 1801
                }
            ],
            "playerId": 14816,
            "positions": [
                {
                    "y": 36,
                    "x": 70
                },
                {
                    "y": 42,
                    "x": 74
                }
            ],
            "matchId": 2058007,
            "eventName": "Duel",
            "teamId": 12913,
            "matchPeriod": "2H",
            "eventSec": 1789.1453259999998,
            "subEventId": 11,
            "id": 261446954
        },
        {
            "eventId": 1,
            "subEventName": "Ground defending duel",
            "tags": [
                {
                    "id": 502
                },
                {
                    "id": 701
                },
                {
                    "id": 1802
                }
            ],
            "playerId": 70123,
            "positions": [
                {
                    "y": 64,
                    "x": 30
                },
                {
                    "y": 58,
                    "x": 26
                }
            ],
            "matchId": 2058007,
            "eventName": "Duel",
            "teamId": 5629,
            "matchPeriod": "2H",
            "eventSec": 1789.5934159999997,
            "subEventId": 12,
            "id": 261447236
        }

You can see the corresponding video here: https://youtu.be/GrkiZjoyugA?t=4813. It's the ball touch by Alderweireld.

So, I think we should update the logic here to make sure the correct event gets deleted. Furthermore, I wonder whether it wouldn't be better to convert an Offensive Duel + interception to a Ball receipt (under pressure).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant