From 08ccf5a27ebe4992916c3fb4da23d3fedeaf999b Mon Sep 17 00:00:00 2001 From: "UnravelSports [JB]" Date: Thu, 3 Apr 2025 22:47:46 +0200 Subject: [PATCH] fix incorrect object.id --- README.md | 10 ++++++---- unravel/soccer/dataset/kloppy_polars.py | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c8d12335..4f8c37de 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,11 @@ The **unravelsports** package aims to aid researchers, analysts and enthusiasts by providing intermediary steps in the complex process of converting raw sports data into meaningful information and actionable insights. This package currently supports: -- ⚽🏈 [**Polars DataFrame Conversion**](#polars-dataframes) -- ⚽🏈 [**Graph Neural Network**](#graph-neural-networks) Training, Graph Conversion and Prediction -- ⚽ [**Pressing Intensity**](#pressing-intensity) [[Bekkers (2024)](https://unravelsports.github.io/2024/12/12/pressing-intensity.html)] +- ⚽ 🏈 [**Polars DataFrame Conversion**](#polars-dataframes) +- ⚽ 🏈 [**Graph Neural Network**](#graph-neural-networks) Training, Graph Conversion and Prediction + [[Bekkers & Sahasrabudhe (2023)](https://arxiv.org/pdf/2411.17450)] +- ⚽ [**Pressing Intensity**](#pressing-intensity) + [[Bekkers (2024)](https://arxiv.org/pdf/2501.04712)] 🌀 Features ----- @@ -138,7 +140,7 @@ The easiest way to get started is: pip install unravelsports ``` -Due to compatibility issues **unravelsports** currently only works on Python 3.11 with: +⚠️ Due to compatibility issues **unravelsports** currently only works on Python 3.11 with: ``` spektral==1.20.0 tensorflow==2.14.0 diff --git a/unravel/soccer/dataset/kloppy_polars.py b/unravel/soccer/dataset/kloppy_polars.py index b976b748..3dd3a2c9 100644 --- a/unravel/soccer/dataset/kloppy_polars.py +++ b/unravel/soccer/dataset/kloppy_polars.py @@ -405,7 +405,9 @@ def __melt( for k, coordinate in enumerate([Column.X, Column.Y, Column.Z]): if object.id != Constant.BALL and coordinate == Column.Z: continue - if not any(object.id in column for column in columns): + if not any( + object.id + "_" + coordinate == column for column in columns + ): continue melted_df = self.__unpivot(df, object, coordinate)