-
Notifications
You must be signed in to change notification settings - Fork 65
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 transform orientation #190
Fix transform orientation #190
Conversation
Looks good to me. The checks with the |
b50bbe9
to
08aae0c
Compare
Thanks. I did a grep-search on "attacking_direction" and I think the attribute is not used anywhere else anymore. |
I think the failing part of the test should be removed as |
That sounds like a band-aid solution 😉 Being redundant does not mean that it shouldn't be correct and consistent. I also don't know what is incorrect in the SecondSpectrum deserializer: the orientation attribute or the attacking direction attributes. I didn't really look into it. I only made the observation that one of them must be wrong. But a relevant question is what we want to do with the |
Ah sorry, didn't want to propose a "just remove the failing test" to solve the issue :-) My idea is/was to remove the Currently the |
My take on this is that the orientation is defined by the attacking direction in each half. Hence, if you transform the orientation, the attacking directions should be updated too. That is how I implemented it in this PR. If a dataset has a known (FIXED_)HOME/AWAY_TEAM orientation, it implies that you also know in which direction a team is attacking. Hence, the attacking direction attribute is redundant, but it could be a convenient alternative interface to infer the attacking direction when working with individual frames since each frame has a period and therefore also an attacking direction attribute. If a dataset has a BALL_OWNING_TEAM or ACTION_EXECUTING_TEAM orientation, the attacking direction attribute is currently useless and confusing. If you follow my reasoning that the attacking direction and orientation are linked, the attacking direction should not be defined for a period but for each team in each frame or possession. Therefore, I set the attacking direction of periods to "NOT_SET" for these orientations. Anyway, I am also in favor of removing the attacking direction entirely from the codebase since I was confused by it for a very long time too and that would simplify the code. Instead of inferring the attacking direction from the first frame in a period, I would modify the helper to infer the orientation from the first frame in both periods. |
@probberechts and I had a call to discuss this PR. The summary (Pieter can you correct where needed?): Current findings:
To got forward the following changes are required:
@UnravelSports @JanVanHaaren can you have a look at the above? |
The way you put it now is the way I expected the behaviour to be. So yes, that all sounds good to me. As an aside and fwiw, I've used this PR in beta for about a week and have not had any issues with it. |
09c54e7
to
858d1ec
Compare
I've updated the first message in this thread with an overview of all changes. The only thing that I implemented differently from what we discussed is the |
858d1ec
to
c844248
Compare
c844248
to
459c007
Compare
I've fixed merge conflicts and changed the "FIXED_" prefix to "STATIC_". |
@probberechts could you fix merge conflict? Would like to merge this PR. |
e2cb448
to
2f0e5b3
Compare
@koenvo Done! |
Thanks! |
This PR makes the following changes:
Breaking changes
Orientation.FIXED_HOME_AWAY
,Orientation.FIXED_AWAY_HOME
,Orientation.HOME_TEAM
, andOrientation.AWAY_TEAM
was counter-intuitive. For example, when the orientation isFIXED_HOME_AWAY
the user expects that the home team will play from left-to-right the entire dataset, while it changes during halftime. Therefore, the definition of these orientations was changed as follows:AttackingDirection.HOME_AWAY
was renamed toAttackingDirection.LTR
(indicating that the home team attacks left-to-right) andAttackingDirection.AWAY_HOME
was renamed toAttackingDirection.RTL
(indicating that the home team attacks right-to-left) to avoid confusion with the identically named orientations.attacking_direction
attribute was removed fromPeriod
. Instead, the attacking direction is now defined for eachDataRecord
as a property derived from the dataset's orientation.Fixes
Orientation.HOME_TEAM
toOrientation.HOME_AWAY
. The home team always starts left-to-right and changes at half-time.Orientation.HOME_TEAM
/Orientation.AWAY_TEAM
toOrientation.HOME_AWAY
/Orientation.AWAY_HOME
. The teams change halves at half-time.Features