From da2afcb02ec73d919e6af8e8683005dea805f94c Mon Sep 17 00:00:00 2001 From: Koen Vossen Date: Mon, 5 Jun 2023 22:28:35 +0200 Subject: [PATCH] Bump version to 3.11.0 --- docs/changelog.md | 11 + docs/getting-started/statsperform.ipynb | 291 ++++++++++++++++++++++++ kloppy/__init__.py | 2 +- mkdocs.yml | 3 +- 4 files changed, 305 insertions(+), 2 deletions(-) create mode 100644 docs/getting-started/statsperform.ipynb diff --git a/docs/changelog.md b/docs/changelog.md index f02932ea..5ad74fad 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,6 +3,17 @@ Find out all changes between different kloppy versions +## 3.11.0 (2023-06-05) + +Pull requests merged: + +- Fix datatype of SkillCorner metadata.periods ([#189](https://github.com/PySport/kloppy/pull/189)) +- Fix inputs of kloppy.helpers.transform ([#186](https://github.com/PySport/kloppy/pull/186)) +- Refactor pathlib tests ([#193](https://github.com/PySport/kloppy/pull/193)) +- StatsPerform deserializer ([#191](https://github.com/PySport/kloppy/pull/191)) +- Allow chaining of operators on a Dataset (filter + map) ([#183](https://github.com/PySport/kloppy/pull/183)) +- Opta remove deleted events ([#182](https://github.com/PySport/kloppy/pull/182)) + ## 3.10.0 (2023-04-13) Pull requests merged: diff --git a/docs/getting-started/statsperform.ipynb b/docs/getting-started/statsperform.ipynb new file mode 100644 index 00000000..1b207cf0 --- /dev/null +++ b/docs/getting-started/statsperform.ipynb @@ -0,0 +1,291 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a93fc613", + "metadata": {}, + "source": [ + "# StatsPerform\n", + "\n", + "## Load local files" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "e803a78c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
period_idtimestampframe_idball_stateball_owning_team_idball_xball_yball_za2s2c6anax9wnlsw1s6vunl5h_xa2s2c6anax9wnlsw1s6vunl5h_y...6wfwy94p5bm0zv3aku0urfq39_d6wfwy94p5bm0zv3aku0urfq39_s6ekdnbnk56xlxforb5owt3dn9_x6ekdnbnk56xlxforb5owt3dn9_y6ekdnbnk56xlxforb5owt3dn9_d6ekdnbnk56xlxforb5owt3dn9_sct32113pfx5q9avf2c0x208ru_xct32113pfx5q9avf2c0x208ru_yct32113pfx5q9avf2c0x208ru_dct32113pfx5q9avf2c0x208ru_s
010.01598184000000aliveNone52.35033.2500.052.80323.617...NoneNone5.26833.556NoneNoneNaNNaNNoneNone
110.11598184000100aliveNone50.61535.3250.052.55823.752...NoneNone5.26533.529NoneNoneNaNNaNNoneNone
210.21598184000200aliveNone49.63036.1400.052.31023.901...NoneNone5.26433.502NoneNoneNaNNaNNoneNone
310.31598184000300aliveNone48.72536.6250.052.05924.071...NoneNone5.26833.476NoneNoneNaNNaNNoneNone
410.41598184000400aliveNone47.89037.1300.051.80424.260...NoneNone5.27733.452NoneNoneNaNNaNNoneNone
\n", + "

5 rows × 100 columns

\n", + "
" + ], + "text/plain": [ + " period_id timestamp frame_id ball_state ball_owning_team_id ball_x \n", + "0 1 0.0 1598184000000 alive None 52.350 \\\n", + "1 1 0.1 1598184000100 alive None 50.615 \n", + "2 1 0.2 1598184000200 alive None 49.630 \n", + "3 1 0.3 1598184000300 alive None 48.725 \n", + "4 1 0.4 1598184000400 alive None 47.890 \n", + "\n", + " ball_y ball_z a2s2c6anax9wnlsw1s6vunl5h_x a2s2c6anax9wnlsw1s6vunl5h_y \n", + "0 33.250 0.0 52.803 23.617 \\\n", + "1 35.325 0.0 52.558 23.752 \n", + "2 36.140 0.0 52.310 23.901 \n", + "3 36.625 0.0 52.059 24.071 \n", + "4 37.130 0.0 51.804 24.260 \n", + "\n", + " ... 6wfwy94p5bm0zv3aku0urfq39_d 6wfwy94p5bm0zv3aku0urfq39_s \n", + "0 ... None None \\\n", + "1 ... None None \n", + "2 ... None None \n", + "3 ... None None \n", + "4 ... None None \n", + "\n", + " 6ekdnbnk56xlxforb5owt3dn9_x 6ekdnbnk56xlxforb5owt3dn9_y \n", + "0 5.268 33.556 \\\n", + "1 5.265 33.529 \n", + "2 5.264 33.502 \n", + "3 5.268 33.476 \n", + "4 5.277 33.452 \n", + "\n", + " 6ekdnbnk56xlxforb5owt3dn9_d 6ekdnbnk56xlxforb5owt3dn9_s \n", + "0 None None \\\n", + "1 None None \n", + "2 None None \n", + "3 None None \n", + "4 None None \n", + "\n", + " ct32113pfx5q9avf2c0x208ru_x ct32113pfx5q9avf2c0x208ru_y \n", + "0 NaN NaN \\\n", + "1 NaN NaN \n", + "2 NaN NaN \n", + "3 NaN NaN \n", + "4 NaN NaN \n", + "\n", + " ct32113pfx5q9avf2c0x208ru_d ct32113pfx5q9avf2c0x208ru_s \n", + "0 None None \n", + "1 None None \n", + "2 None None \n", + "3 None None \n", + "4 None None \n", + "\n", + "[5 rows x 100 columns]" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from kloppy import statsperform\n", + "\n", + "dataset = statsperform.load(\n", + " raw_data=\"../../kloppy/tests/files/statsperform_ma25_tracking.txt\",\n", + " meta_data=\"../../kloppy/tests/files/statsperform_ma1_metadata.xml\",\n", + " \n", + " # Optional arguments\n", + " coordinates=\"statsperform\"\n", + ")\n", + "\n", + "dataset.to_df().head()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6780ce08", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "kloppy-venv", + "language": "python", + "name": "kloppy-venv" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/kloppy/__init__.py b/kloppy/__init__.py index 57527cca..a3526d7a 100644 --- a/kloppy/__init__.py +++ b/kloppy/__init__.py @@ -13,4 +13,4 @@ # ) # from .domain.services.state_builder import add_state -__version__ = "3.10.1" +__version__ = "3.11.0" diff --git a/mkdocs.yml b/mkdocs.yml index e78ecd88..0f36f080 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: kloppy 3.10.0 +site_name: kloppy 3.11.0 site_url: https://kloppy.pysport.org repo_url: https://github.com/PySport/kloppy repo_name: 'GitHub' @@ -24,6 +24,7 @@ nav: - Sportec: getting-started/sportec.ipynb - Sportscode: getting-started/sportscode.ipynb - Statsbomb: getting-started/statsbomb.ipynb + - StatsPerform: getting-started/statsperform.ipynb - TRACAB: getting-started/tracab.ipynb - Wyscout: getting-started/wyscout.ipynb - Examples: