[BUG] Fix setting metadata after transform #414
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As mentioned here #407 when calling
replace()
on the metadata the changes are not actually reflected in the new metadata object.Aka, the below simply doesn't work:
Since
Metadata
is not afrozen
dataclass we can also update the existing metadata as follows:Finally, at the end of the transformation we do this:
For some reason this messed up a test (see below) because "action_executing_team" was not set when calling
frame_t4.attacking_direction
. However, I think this is an issue with how the test was set up, because a TrackingDataset (which is used in this test) does not have the ability to be set toACTION_EXECUTING_TEAM
, and it should instead be transformed toBALL_OWNING_TEAM
instead.