Skip to content

Commit

Permalink
build: release 0.3.3
Browse files Browse the repository at this point in the history
build: release 0.3.3
  • Loading branch information
draabe authored Aug 23, 2022
2 parents 02c6476 + a57df73 commit 55a24b7
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 756 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ jobs:

- name: Test with pytest
run: |
poetry run pytest
poetry run pytest --cov --cov-report xml .
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# Changelog

## 0.3.2 (2022-06-08)
## 0.3.3 (2022-08-23)

#### Fixes

* UTF-8 encoding Kinexon parser
* UFT-8 encoding Kinexon parser
* minimum signal length ([#81](https://github.com/floodlight-sports/floodlight/issues/81))
* statsperform pitch templates ([#75](https://github.com/floodlight-sports/floodlight/issues/75))
* adapt dfl parser to different format versions and fix statsperform gameclock unit ([#76](https://github.com/floodlight-sports/floodlight/issues/76))
* pass difference argument to axis-specific differentiation and fix prepend ([#77](https://github.com/floodlight-sports/floodlight/issues/77))
#### Docs

* add information on setup.py
* update datasets description
* update readme
* update changelog
* add paper reference
#### Others

* add dependency pytest-cov
* add dependency coverage
* bump version
* add coverage reports generation and codecov upload
* update readme
* update module init

Full set of changes: [`0.3.1...0.3.2`](https://github.com/floodlight-sports/floodlight/compare/0.3.1...0.3.2)
Full set of changes: [`0.3.1...0.3.3`](https://github.com/floodlight-sports/floodlight/compare/0.3.1...0.3.3)

## 0.3.1 (2022-06-06)

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If all or some of this is new to you, and you would prefer a detailed step-by-st
Development
-----------

We use *poetry* for development and dependency management, so setting up your local dev environment is rather straightforward:
We use *poetry* for development and dependency management, which is based on the static `pyproject.toml` file and replaces `setup.py`. With *poetry*, setting up your local dev environment is rather straightforward:

1. Fork and Clone this repository
2. Install poetry if you have not done so yet
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[python-url]: https://pypi.org/project/floodlight/
[docs-image]: https://readthedocs.org/projects/floodlight/badge/?version=latest
[docs-url]: https://floodlight.readthedocs.io/en/latest/?badge=latest
[tutorial-url]: https://floodlight.readthedocs.io/en/latest/guides/getting_started.html
[build-image]: https://github.com/floodlight-sports/floodlight/actions/workflows/build.yaml/badge.svg
[build-url]: https://github.com/floodlight-sports/floodlight/actions/workflows/build.yaml
[lint-image]: https://github.com/floodlight-sports/floodlight/actions/workflows/linting.yaml/badge.svg
Expand All @@ -14,6 +15,8 @@
[contrib-url]: https://github.com/floodlight-sports/floodlight/blob/main/CONTRIBUTING.md
[arxiv-image]: https://img.shields.io/badge/arXiv-2206.02562-b31b1b.svg
[arxiv-url]: https://arxiv.org/abs/2206.02562
[codecov-image]: https://codecov.io/gh/floodlight-sports/floodlight/branch/develop/graph/badge.svg?token=RLY582UBC6
[codecov-url]: https://codecov.io/gh/floodlight-sports/floodlight


# floodlight
Expand All @@ -22,6 +25,7 @@
[![Documentation Status][docs-image]][docs-url]
[![Build Status][build-image]][build-url]
[![Linting Status][lint-image]][lint-url]
[![Codecov][codecov-image]][codecov-url]
[![Code style: black][black-image]][black-url]
[![arXiv][arxiv-image]][arxiv-url]

Expand All @@ -43,13 +47,44 @@ about data wrangling and start focussing on the analysis instead!

----------------------------------------------------------------------------------------

* [Quick Demo](#quick-demo)
* [Features](#features)
* [Installation](#installation)
* [Documentation](#documentation)
* [How to contribute](#contributing)

----------------------------------------------------------------------------------------

### Quick Demo

**floodlight** simplifies sports data loading, processing and advanced performance
analyses. Check out the example below, where querying a public data sample, filtering
the data and computing the expended metabolic work of the active home team players is
done in a few lines of code:

```
>>> from floodlight.io.datasets import EIGDDataset
>>> from floodlight.transforms.filter import butterworth_lowpass
>>> from floodlight.models.kinetics import MetabolicPowerModel
>>> dataset = EIGDDataset()
>>> home_team_data, away_team_data, ball_data = dataset.get()
>>> home_team_data = butterworth_lowpass(home_team_data)
>>> model = MetabolicPowerModel()
>>> model.fit(home_team_data)
>>> metabolic_power = model.cumulative_metabolic_power()
>>> print(metabolic_power[-1, 0:7])
[1669.18781115 1536.22481121 1461.03243489 1488.61249785 773.09264071
1645.01702421 746.94057676]
```

To find out more, see the full set of features below or get started quickly with
[one of our many tutorials][tutorial-url] from the official documentation!


### Features

Expand Down
3 changes: 2 additions & 1 deletion docs/source/guides/contrib_manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Developing

Let's start and install our repository in *dev*-mode for developing. This installation differs from *production*-mode. The latter describes the ready-to-use version of the package as you would install it e.g. from PyPI. *Dev*-mode, on the contrary, refers to the direct copy of the repository as you would find it on GitHub, including tools used for developing, testing, quality assurance and all (public) branches where new features are developed.

This mode has more dependencies which change regularly as we develop the next release, i.e., a snapshot of a publishable version of the code. Dependency management (and packaging) used to be inconvenient in Python, yet it is important that every contributor works on the same environment when collaborating on code. Luckily, there's a tool called *poetry* which simplifies this a lot. Thus, the first step is to install poetry!
This mode has more dependencies which change regularly as we develop the next release, i.e., a snapshot of a publishable version of the code. Dependency management (and packaging) used to be inconvenient in Python, yet it is important that every contributor works on the same environment when collaborating on code. Luckily, there's a tool called *poetry* which simplifies this a lot. *poetry* works with the static ``pyproject.toml`` file containing project metadata, and replaces the usage of ``setup.py`` files. Thus, the first step is to install poetry!


Poetry requires a system-wide installation that's different on Windows and MacOS. The full installation instructions can be found on `the official page <https://python-poetry.org/docs/master/#installation>`_. The quick four-step-version goes:

Expand Down
6 changes: 6 additions & 0 deletions docs/source/modules/io/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@
floodlight.io.datasets
======================

.. note::
We cannot guarantee data availability for public data sets, unfortunately. Data from published articles (e.g. the EIGD) should be permanently available and stay static. Public provider data from StatsBomb is available on GitHub, but unversioned and with dynamically changing content. You can find methods to query the current list of games, and we also state the last date that we found the data to be available.

As public data sets for proprietary sports data are fairly rare, the standard way of accessing data is still via provider raw data files. To load these, we have more than ten parser for different provider formats in the IO submodule!


.. automodule:: floodlight.io.datasets
:members:
2 changes: 1 addition & 1 deletion floodlight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"XY",
]

__version__ = "0.3.2"
__version__ = "0.3.3"

__doc__ = """
A high-level, data-driven sports analytics framework
Expand Down
2 changes: 1 addition & 1 deletion floodlight/io/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class StatsBombOpenDataset:
The UEFA Euro data contains 51 matches where StatsBomb360 data is available.
As the data is constantly updated, we provide an overview over the stats here but
refer to the official repository for up-to-date information (last
modified 12.05.2022)::
checked 20.08.2022)::
number_of_matches = {
"Champions League": {
Expand Down
6 changes: 3 additions & 3 deletions floodlight/io/kinexon.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_column_names_from_csv(filepath_data: Union[str, Path]) -> List[str]:
List with every column name of the .csv-file.
"""

with open(str(filepath_data)) as f:
with open(str(filepath_data), encoding="utf-8") as f:
columns = f.readline().split(",")

return columns
Expand Down Expand Up @@ -199,7 +199,7 @@ def get_meta_data(
warnings.warn("Since no group exist in data, dummy group '0' is created!")

# loop
with open(str(filepath_data), "r") as f:
with open(str(filepath_data), "r", encoding="utf-8") as f:
# skip the header of the file
_ = f.readline()
while True:
Expand Down Expand Up @@ -383,7 +383,7 @@ def read_kinexon_file(filepath_data: Union[str, Path]) -> List[XY]:
)

# loop
with open(str(filepath_data), "r") as f:
with open(str(filepath_data), "r", encoding="utf-8") as f:
# skip the header of the file
_ = f.readline()
while True:
Expand Down
4 changes: 2 additions & 2 deletions floodlight/transforms/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def _get_filterable_and_short_sequences(
non_nan_sequences = sequences[seq_is_nan == 1]
# split remaining sequences into filterable and short
filterable_sequences = non_nan_sequences[
(non_nan_sequences[:, 1] - non_nan_sequences[:, 0]) >= min_signal_len
(non_nan_sequences[:, 1] - non_nan_sequences[:, 0]) > min_signal_len
]
short_sequences = non_nan_sequences[
(non_nan_sequences[:, 1] - non_nan_sequences[:, 0]) < min_signal_len
(non_nan_sequences[:, 1] - non_nan_sequences[:, 0]) <= min_signal_len
]

return filterable_sequences, short_sequences
Expand Down
Loading

0 comments on commit 55a24b7

Please sign in to comment.