From bd4db7302afd95d8797bf28dbb1434d0ee3bd96b Mon Sep 17 00:00:00 2001 From: Koen Vossen Date: Tue, 8 Sep 2020 15:21:28 +0200 Subject: [PATCH] fix for python3.6 --- docs/changelog.md | 8 ++++++++ kloppy/domain/services/state_builder/builder.py | 6 +++--- kloppy/domain/services/state_builder/builders/lineup.py | 2 +- kloppy/domain/services/state_builder/builders/score.py | 2 +- kloppy/domain/services/state_builder/builders/sequence.py | 2 +- kloppy/tests/test_state_builder.py | 2 +- mkdocs.yml | 2 +- setup.py | 2 +- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 69336136..2a1c9e3f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,14 @@ Find out all changes between different kloppy versions +## 1.2.0 (2020-09-08) +Github issues closed: + +- Enrich events with state ([#48](https://github.com/PySport/kloppy/issues/48)) + +Other pull requested merged: + +- Chaining of methods ([#59](https://github.com/PySport/kloppy/pull/59)) ## 1.1.1 (2020-09-01) Github issues closed: diff --git a/kloppy/domain/services/state_builder/builder.py b/kloppy/domain/services/state_builder/builder.py index 55b3de80..e2af3399 100644 --- a/kloppy/domain/services/state_builder/builder.py +++ b/kloppy/domain/services/state_builder/builder.py @@ -1,5 +1,5 @@ -from abc import abstractmethod, ABC -from typing import TypeVar, Generic +from abc import abstractmethod +from typing import TypeVar from kloppy.domain import EventDataset, Event from .registered import RegisteredStateBuilder @@ -7,7 +7,7 @@ T = TypeVar("T") -class StateBuilder(Generic[T], metaclass=RegisteredStateBuilder): +class StateBuilder(metaclass=RegisteredStateBuilder): @abstractmethod def initial_state(self, dataset: EventDataset) -> T: pass diff --git a/kloppy/domain/services/state_builder/builders/lineup.py b/kloppy/domain/services/state_builder/builders/lineup.py index 43507d65..7ceee158 100644 --- a/kloppy/domain/services/state_builder/builders/lineup.py +++ b/kloppy/domain/services/state_builder/builders/lineup.py @@ -20,7 +20,7 @@ class Lineup: players: Set[Player] -class LineupStateBuilder(StateBuilder[Lineup]): +class LineupStateBuilder(StateBuilder): def initial_state(self, dataset: EventDataset) -> Lineup: if dataset.metadata.provider != Provider.STATSBOMB: raise Exception( diff --git a/kloppy/domain/services/state_builder/builders/score.py b/kloppy/domain/services/state_builder/builders/score.py index c959aea2..eca205b3 100644 --- a/kloppy/domain/services/state_builder/builders/score.py +++ b/kloppy/domain/services/state_builder/builders/score.py @@ -13,7 +13,7 @@ def __str__(self): return f"{self.home}-{self.away}" -class ScoreStateBuilder(StateBuilder[Score]): +class ScoreStateBuilder(StateBuilder): def initial_state(self, dataset: EventDataset) -> Score: return Score(home=0, away=0) diff --git a/kloppy/domain/services/state_builder/builders/sequence.py b/kloppy/domain/services/state_builder/builders/sequence.py index b961f72a..6a5f4c5d 100644 --- a/kloppy/domain/services/state_builder/builders/sequence.py +++ b/kloppy/domain/services/state_builder/builders/sequence.py @@ -10,7 +10,7 @@ class Sequence: team: Team -class SequenceStateBuilder(StateBuilder[Sequence]): +class SequenceStateBuilder(StateBuilder): def initial_state(self, dataset: EventDataset) -> Sequence: for event in dataset.events: if isinstance(event, PassEvent): diff --git a/kloppy/tests/test_state_builder.py b/kloppy/tests/test_state_builder.py index cb9792f9..8d25445c 100644 --- a/kloppy/tests/test_state_builder.py +++ b/kloppy/tests/test_state_builder.py @@ -70,7 +70,7 @@ def test_lineup_state_builder(self): ] def test_register_custom_builder(self): - class CustomStateBuilder(StateBuilder[int]): + class CustomStateBuilder(StateBuilder): def initial_state(self, dataset: EventDataset) -> int: return 0 diff --git a/mkdocs.yml b/mkdocs.yml index 357466fd..5709163b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: kloppy 1.1.1 +site_name: kloppy 1.2.0 site_url: https://kloppy.pysport.org repo_url: https://github.com/PySport/kloppy repo_name: 'GitHub' diff --git a/setup.py b/setup.py index 159a3a36..9daacced 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="kloppy", - version="1.1.1", + version="1.2.0", author="Koen Vossen", author_email="info@koenvossen.nl", url="https://kloppy.pysport.org/",