Skip to content

Substitutions, players temporarily leaving pitch in Kloppy EventData model and dataframe #362

@ghost

Description

Before 3.16.0, in the Opta Parser specifically, PLAYER_ON and PLAYER_OFF are used to describe a substitution with these two individual events.

In (currently officially not yet released) version 3.16.0 we add a breaking change to this by adding the SUBSTITUTION event. Where the SUBSTITUTION event is now the combination of PLAYER_ON and PLAYER_OFF events in case of a substitution. However, the PLAYER_ON and PLAYER_OFF events can also relate to players temporarily retiring from the pitch as shared by @DriesDeprest in #361.

Some ideas for behavior as discussed by @DriesDeprest @probberechts and me for the Kloppy EventData model should be:

  • Make PLAYER_ON and PLAYER_OFF more specific to mean PLAYER_RETIRES and PLAYER_RETURNS for any event that is unrelated to a substitution.
  • In case of a substitution use the SUBSTITUTION event and assign the replacement_player the Id of the player coming on. (This is implemented in a commit in #333
  • Deprecate the use of PLAYER_ON and PLAYER_OFF explicitly as they are confusing and ambiguous. Similarly to how we did away with HOME_AWAY orientation in favor of STATIC_HOME_AWAY and they were explicitly renamed.

Idea for the implementation in the dataframe representation:

  • Set the replacement_player in the receiving_player field for the SUBSTITUTION event.
  • Remove the GENERIC:player off and GENERIC:player on in favor of GENERIC:player retires and GENERIC: player returns events respectively.

Let me know if I forgot anything or if anyone has any suggestions on this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions