From 692de42644d1b69c4d0655f4d994f34958a842aa Mon Sep 17 00:00:00 2001 From: Koen Vossen Date: Mon, 18 Sep 2023 21:53:42 +0200 Subject: [PATCH] Fix some merge issues --- .gitignore | 2 ++ kloppy/infra/serializers/event/opta/deserializer.py | 3 ++- kloppy/tests/files/opta_f24.xml | 1 + kloppy/tests/test_opta.py | 6 +++--- kloppy/tests/test_wyscout.py | 5 ++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index d7354f77..41589f10 100644 --- a/.gitignore +++ b/.gitignore @@ -148,3 +148,5 @@ examples/pattern_matching/repository/*.json *.code-workspace .* + +scratchpad \ No newline at end of file diff --git a/kloppy/infra/serializers/event/opta/deserializer.py b/kloppy/infra/serializers/event/opta/deserializer.py index db1a0975..67808c0b 100644 --- a/kloppy/infra/serializers/event/opta/deserializer.py +++ b/kloppy/infra/serializers/event/opta/deserializer.py @@ -766,7 +766,8 @@ def deserialize(self, inputs: OptaInputs) -> EventDataset: raw_qualifiers, type_id ) event = self.event_factory.build_goalkeeper_event( - **goalkeeper_event_kwargs, + **goalkeeper_event_kwargs, **generic_event_kwargs + ) elif (type_id == EVENT_TYPE_BALL_TOUCH) & (outcome == 0): event = self.event_factory.build_miscontrol( result=None, diff --git a/kloppy/tests/files/opta_f24.xml b/kloppy/tests/files/opta_f24.xml index 50ac1b17..fa411c02 100644 --- a/kloppy/tests/files/opta_f24.xml +++ b/kloppy/tests/files/opta_f24.xml @@ -286,6 +286,7 @@ + diff --git a/kloppy/tests/test_opta.py b/kloppy/tests/test_opta.py index 4301e716..777bd5a0 100644 --- a/kloppy/tests/test_opta.py +++ b/kloppy/tests/test_opta.py @@ -115,9 +115,6 @@ def test_correct_deserialization(self, f7_data: str, f24_data: str): assert dataset.events[18].result.value == "OWN_GOAL" # 2318697001 # Check OFFSIDE pass has end_coordinates assert dataset.events[20].receiver_coordinates.x == 89.3 # 2360555167 - assert ( - dataset.events[23].event_type == EventType.MISCONTROL - ) # 250913217 # Check goalkeeper qualifiers assert ( @@ -140,6 +137,9 @@ def test_correct_deserialization(self, f7_data: str, f24_data: str): dataset.events[27].get_qualifier_value(GoalkeeperQualifier) == GoalkeeperActionType.SMOTHER ) + assert ( + dataset.events[28].event_type == EventType.MISCONTROL + ) # 250913217 # Check counterattack assert ( diff --git a/kloppy/tests/test_wyscout.py b/kloppy/tests/test_wyscout.py index 93e757e5..56c552b7 100644 --- a/kloppy/tests/test_wyscout.py +++ b/kloppy/tests/test_wyscout.py @@ -67,10 +67,9 @@ def test_correct_v2_deserialization(self, event_v2_data: Path): data_version="V2", ) assert dataset.records[2].coordinates == Point(29.0, 6.0) - assert dataset.events[137].event_type == EventType.CLEARANCE assert dataset.events[11].event_type == EventType.MISCONTROL - assert dataset.events[136].event_type == EventType.CLEARANCE - + assert dataset.events[137].event_type == EventType.CLEARANCE + assert ( dataset.events[39].get_qualifier_value(DuelQualifier) == DuelType.GROUND