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 shot end coordinates for Opta deserializer #247

Merged
merged 2 commits into from
Dec 26, 2023

Conversation

probberechts
Copy link
Contributor

The end coordinates of blocked and saved shots were based on the projection of the shot on the goal mouth instead of the shot's actual end location.

This commit uses the x and y coordinates of the location were the shots was blocked (qualifiers 146 and 147) and inversely projects the goalmouth z coordinate (qualifier 103) on the location were the shot was blocked.

Fixes #244

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.

I like this approach. The implementation looks good to me. Thanks!

Would it be possible to add a test for this functionality as well? Concretely, a test for the projection of the z-coordinate would be very useful in my opinion.

The end coordinates of blocked and saved shots were based on the projection of the shot on the goal mouth instead of the shot's actual end location.

This commit uses the x and y coordinates of the location were the shots was blocked (qualifiers 146 and 147) and inversely projects the goalmouth z  coordinate (qualifier 103) on the location were the shot was blocked.

Fixes PySport#244
@probberechts probberechts force-pushed the fix/opta-shot-result-coordinates branch from 5b35173 to b6b523b Compare December 14, 2023 15:28
@probberechts
Copy link
Contributor Author

A unit test was added ✔️

@JanVanHaaren JanVanHaaren self-requested a review December 15, 2023 06:32
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 koenvo merged commit 8160d98 into PySport:master Dec 26, 2023
19 checks passed
@koenvo koenvo added this to the 3.14 - Pi milestone Dec 29, 2023
@probberechts probberechts deleted the fix/opta-shot-result-coordinates 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.

Opta deserializer incorrectly sets end coordinate of saved shots
3 participants