From 2e17adff853ea89e8ed94cf4d4f844a53981681a Mon Sep 17 00:00:00 2001 From: Calvin Yeung Date: Wed, 18 Feb 2026 17:29:22 +0900 Subject: [PATCH 1/2] update --- .../event_data/soccer/soccer_processing.py | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/preprocessing/sports/event_data/soccer/soccer_processing.py b/preprocessing/sports/event_data/soccer/soccer_processing.py index 1c3749b..9f8b221 100644 --- a/preprocessing/sports/event_data/soccer/soccer_processing.py +++ b/preprocessing/sports/event_data/soccer/soccer_processing.py @@ -1955,14 +1955,14 @@ def UIED_bepro(data): #group the event into simpliefied actions - short_pass_actions=['Passes', 'Set Pieces', 'Key Passes',] + short_pass_actions=['Passes', 'Set Pieces',] long_pass_actions=[] high_pass_actions=[] shot_actions=['Shots & Goals',] carray_actions=[] dribble_actions=[] cross_actions=['Crosses',] - drop_actions=[ 'Passes Received', 'Turnovers', + drop_actions=[ 'Passes Received', 'Turnovers', 'Key Passes', 'Interceptions', 'Aerial Control', 'Clearances', 'Recoveries', 'Step-in', 'Blocks', 'Tackles', 'Take-on', 'Duels', 'Fouls', 'Mistakes', @@ -1974,11 +1974,21 @@ def UIED_bepro(data): for i in range(len(df)): if df["action"].iloc[i] in short_pass_actions: distance_i = np.sqrt((df["x_unscaled"].iloc[i] - df["to_x_unscaled"].iloc[i])**2 +\ - (df["y_unscaled"].iloc[i] - df["to_y_unscaled"].iloc[i])**2) - if distance_i>=45: - action_list.append("long_pass") + (df["y_unscaled"].iloc[i] - df["to_y_unscaled"].iloc[i])**2) + + if i!=len(df)-1 and df["action"].iloc[i]=='Set Pieces': + if df["x"].iloc[i]==df["x"].iloc[i+1] and df["y"].iloc[i]==df["y"].iloc[i+1]: + action_list.append("drop") + else: + if distance_i>=45: + action_list.append("long_pass") + else: + action_list.append("short_pass") else: - action_list.append("short_pass") + if distance_i>=45: + action_list.append("long_pass") + else: + action_list.append("short_pass") elif df["action"].iloc[i] in high_pass_actions: action_list.append("high_pass") @@ -2165,6 +2175,10 @@ def UIED_bepro(data): tracking_col_home = [col for col in tracking_col_home if col != "home_team"] tracking_col_away = df.columns[df.columns.str.startswith("away_")].tolist() + #check if match_id is in the col + if "match_id" not in df.columns: + df["match_id"] = 0 + df = df[['match_id', 'poss_id', 'team', 'home_team', 'action', 'success', 'goal', 'home_score', 'away_score', 'goal_diff', 'Period', 'Minute', 'Second', 'seconds', "delta_T", 'start_x', 'start_y', 'deltaX', 'deltaY', 'distance', 'dist2goal', 'angle2goal']+tracking_col_home+tracking_col_away] From 61320856eede7d308ac4cd05977e1cf31661b249 Mon Sep 17 00:00:00 2001 From: Calvin Yeung Date: Wed, 18 Feb 2026 17:29:57 +0900 Subject: [PATCH 2/2] update --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c270bc6..e99530b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "openstarlab_preprocessing" -version = "0.1.53" +version = "0.1.54" description = "openstarlab preprocessing package" readme = "README.md" requires-python = ">=3.8"