Skip to content

Conversation

@DriesDeprest
Copy link
Contributor

Context
Sometimes, when analyzing event data, we want to exclude actions that occurred during the penalty shootout, as including them can distort player statistics such as shots and goals.

Functionality
Add support for excluding penalty shootout events (period 5) when loading event data across all providers. This feature provides complete cleanup of penalty shootout data from the dataset.

Changes

  • Add exclude_penalty_shootouts parameter to EventDataDeserializer
  • Implement should_include_event() filtering for period 5 events
  • Add remove_penalty_shootout_data() method to clean up metadata:
    • Removes period 5 from metadata.periods
    • Updates period references (prev/next)
    • Removes player positions for period 5
    • Removes team formations for period 5
  • Update all provider load functions to support the parameter:
    • StatsBomb, Opta, Wyscout, DataFactory, Impect
    • StatsPerform, Sportec, Metrica
  • Add comprehensive tests in test_event.py

The parameter defaults to False for backward compatibility.

🤖 Generated with Claude Code

Add support for excluding penalty shootout events (period 5) when loading
event data across all providers. This feature provides complete cleanup of
penalty shootout data from the dataset.

Changes:
- Add exclude_penalty_shootouts parameter to EventDataDeserializer
- Implement should_include_event() filtering for period 5 events
- Add remove_penalty_shootout_data() method to clean up metadata:
  - Removes period 5 from metadata.periods
  - Updates period references (prev/next)
  - Removes player positions for period 5
  - Removes team formations for period 5
- Update all provider load functions to support the parameter:
  - StatsBomb, Opta, Wyscout, DataFactory, Impect
  - StatsPerform, Sportec, Metrica
- Add comprehensive tests in test_event.py

The parameter defaults to False for backward compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@DriesDeprest
Copy link
Contributor Author

DriesDeprest commented Nov 18, 2025

Let's rewrite it as a method on the (Event)Dataset instead of an argument in the deserializer.

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.

1 participant