Skip to content

Commit

Permalink
Fix some merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
koenvo committed Sep 18, 2023
1 parent bcf08da commit 692de42
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,5 @@ examples/pattern_matching/repository/*.json
*.code-workspace

.*

scratchpad
3 changes: 2 additions & 1 deletion kloppy/infra/serializers/event/opta/deserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions kloppy/tests/files/opta_f24.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
<Event id="2438594253" event_id="965" type_id="54" period_id="2" min="21" sec="35" player_id="111319" team_id="569" outcome="1" x="4.4" y="49.9" timestamp="2018-09-23T17:00:01.850" last_modified="2018-09-23T17:08:02" version="1537718881823">
<Q id="3666298279" qualifier_id="232" />
<Q id="3667330981" qualifier_id="389" />
</Event>
<Event id="2509132175" event_id="50" type_id="61" period_id="1" min="22" sec="6" player_id="460842" team_id="2592" outcome="0" x="1.3" y="81.1" timestamp="2018-09-23T17:21:01.810" last_modified="2018-09-23T17:08:02" version="1537718881823">
<Q id="4042410691" qualifier_id="178" />
<Q id="4039492675" qualifier_id="56" value="Back" />
Expand Down
6 changes: 3 additions & 3 deletions kloppy/tests/test_opta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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 (
Expand Down
5 changes: 2 additions & 3 deletions kloppy/tests/test_wyscout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 692de42

Please sign in to comment.