Skip to content

[StatsBomb] Fix player identity inference issues in freeze frame data#386

Merged
probberechts merged 4 commits into
PySport:masterfrom
AndrewRook:freeze_frame_fix
Dec 26, 2024
Merged

[StatsBomb] Fix player identity inference issues in freeze frame data#386
probberechts merged 4 commits into
PySport:masterfrom
AndrewRook:freeze_frame_fix

Conversation

@AndrewRook
Copy link
Copy Markdown
Contributor

Hi there!

I was trying to use freeze frame data from statsbomb and I think I encountered a couple of small bugs in how player information was connected to the player tracking data. First, there seems to be an issue when getting player positions if a player hasn't been subbed in yet, which I resolved by catching the error and just continuing. Then there's a timing issue when deserializing the data, where position information doesn't seem to be added until the EventDataset is created. I resolved that issue by postponing setting the freeze frame data until after the EventDataset is initialized.

I wasn't sure exactly how the unit tests are laid out, so I added a test for each apparent bug in the test_statsbomb test module, let me know if there's a better place for them. Also, I have no idea if this is the right way to solve these issues (or whether it's about to be obviated by the changes in #377), so please feel free to let me know if there's another way to do it or just close the PR; I just figured I should share my workarounds for the problems I had in case they're more broadly helpful.

@probberechts probberechts changed the title Freeze frame position loading [StatsBomb] Fix player identity inference issues in freeze frame data Dec 26, 2024
@probberechts probberechts merged commit 9cee426 into PySport:master Dec 26, 2024
@probberechts
Copy link
Copy Markdown
Contributor

Thanks!

@probberechts probberechts added this to the 3.17.0 milestone Feb 15, 2025
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.

2 participants