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

Fix FoulComitted + Card for Wyscout v2 #261

Merged
merged 9 commits into from
Dec 29, 2023

Conversation

probberechts
Copy link
Contributor

  • No FoulComitted event was recorded when a card was given. To be consistent with the other data providers both a FoulCommittedEvent and CardEvent are recorded now.
  • Adds CardQualifiers to the FoulCommittedEvent.

- No FoulComitted event was recorded when a card was given. To be consistent with the other data providers both a FoulCommittedEvent and CardEvent are recorded now.
- Adds CardQualifiers to the FoulCommittedEvent.
Adds a prefix to the ID of synthetic events to avoid having multiple events with the same ID.
@probberechts
Copy link
Contributor Author

I made a few more changes:

  • Refactored the Wyscout tests such that you have one unit test per action type
  • Use IDs instead of indexes to select events in the tests, which is much easier to maintain and to find the relevant data record in the test data
  • Removed a few duplicate IDs in the Wyscout v3 test data
  • Fixed the scope of the base_dir fixture. There is no need to recreate a constant for each function, so I've changed the scope to "session".
  • Added a test for FoulCommited + Card events
  • Added a prefix to the ID of synthetic events to avoid having multiple events with the same ID
  • Changed the type of event IDs from int to str. This is consistent with the defined type of event IDs.

Copy link
Collaborator

@JanVanHaaren JanVanHaaren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me. I left a few minor comments.

kloppy/infra/serializers/event/wyscout/deserializer_v2.py Outdated Show resolved Hide resolved
kloppy/infra/serializers/event/wyscout/deserializer_v2.py Outdated Show resolved Hide resolved
kloppy/tests/test_wyscout.py Outdated Show resolved Hide resolved
@probberechts probberechts force-pushed the fix/wyscout-record-foul-on-card branch from a69b89b to ea5715b Compare December 22, 2023 09:26
Copy link
Collaborator

@JanVanHaaren JanVanHaaren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@koenvo
Copy link
Contributor

koenvo commented Dec 26, 2023

Great work @probberechts! Can you merge current master in and resolve conflicts?

Copy link
Contributor

@koenvo koenvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Please resolve merge conflicts

@probberechts probberechts force-pushed the fix/wyscout-record-foul-on-card branch from f8a1750 to 170f6ea Compare December 26, 2023 19:06
@probberechts probberechts force-pushed the fix/wyscout-record-foul-on-card branch from 170f6ea to 38f6aba Compare December 26, 2023 19:08
@probberechts probberechts requested a review from koenvo December 26, 2023 19:10
@koenvo koenvo merged commit b4f1644 into PySport:master Dec 29, 2023
19 checks passed
@koenvo koenvo added this to the 3.14 - Pi milestone Dec 29, 2023
@probberechts probberechts deleted the fix/wyscout-record-foul-on-card branch January 1, 2024 10:04
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

Successfully merging this pull request may close these issues.

3 participants