-
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
[StatsPerform] Bugfixes for tracking data (MA25) + Support for event data (MA3) #310
Conversation
- Use the correct coordinate system and pitch dimensions - Remove "BALL_OWNING_TEAM" flag - Metadata.periods should be a list, not a dict - Skip frames for which ball_state = DEAD when only_alive = True Fixes PySport#299.
3f2b65e
to
49ac769
Compare
49ac769
to
31db470
Compare
@JanVanHaaren were you able to give this a review? |
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.
Although I haven't been able to test each potential scenario, this pull request generally looks good to me. Thank you for this nice contribution!
I suggest to replace the mentions of ma25_data
with opt_data
. Stats Perform typically refers to the raw tracking data as the OPT
data. While the MA25 feed provides a download link to the OPT
data, the OPT
data can also be obtained directly through other Stats Perform platforms.
I was also unsure how to name that input parameter since it is indeed not the |
I agree that naming that input parameter is not trivial. I am fine with keeping
|
How about improving the docstring? Something like:
|
This solution looks good to me! |
Not all stream implementations support the peek method or require different parameters. Co-authored-by: BirCWld <[email protected]>
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.
Thank you!
Bugfixes for deserializing Stats Perform tracking data (MA1 + MA25 feed)
First, this PR fixes a few bugs in the tracking deserializer:
periods
field of the metadata should be a list, not a dict.only_alive = True
.Support for deserializing Stats Perform event data (MA1 + MA3 feed)
Second, it adds support for deserializing event stream data. The content of the Stats Perform MA3 feed is identical to the Opta F27 feed, only the format is different. To avoid duplicate code, I refactored the
OptaDeserializer
to first parse the data intoOptaEvent
s which are subsequently deserialized to kloppy objects. I also renamed theOptaDeserializer
toStatsPerformDeserializer
to convey that it now deserializes feeds that are distributed by Stats Perform (and not only the legacy Opta feeds).Both the XML and JSON versions of the feed are supported.
Other changes