Skip to content

Commit

Permalink
Merge pull request #600 from alan-turing-institute/develop
Browse files Browse the repository at this point in the history
Recent Development
  • Loading branch information
jack89roberts committed Jul 17, 2023
2 parents 69e1721 + 2de483f commit 24d5169
Show file tree
Hide file tree
Showing 63 changed files with 200 additions and 84 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/recent_development_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ you can reinstall AIrsenal from our `develop` branch - there are instructions
## New Features
<!-- List changes that add new functionality to AIrsenal here.-->

-
-

## Enhancements
<!-- List changes that add improve pre-existing AIrsenal components here -->

-
-

## Bug Fixes
<!-- List changes that fix errors and bugs in AIrsenal here -->

-
-

---

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,3 @@ venv.bak/

# mypy
.mypy_cache/

7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
install:
- pip3 install --upgrade pip
- pip3 install .

- name: "Python 3.8"
python: 3.8
install:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.9-slim-buster

RUN apt-get update && \
apt-get install build-essential git sqlite3 curl -y && \
pip install -U setuptools pygmo poetry
pip install -U setuptools poetry

WORKDIR /airsenal

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include airsenal/data/*.json
include airsenal/data/*.json
12 changes: 6 additions & 6 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ The database is filled with data from the previous three FPL seasons (stored in

- **FifaTeamRating:** FIFA (the game) team ratings for each team in each season. These are taken from https://www.fifaindex.com/teams/. Their main use is to give an idea of team strength for promoted teams (but we are considering their use in general - see [Issue #136](https://github.com/alan-turing-institute/AIrsenal/issues/136))


**_Tables with Player Data:_**
- **Player:** Name and ID for each player (for all football players that have been in the FPL game at some point in the last 3 seasons). The ID is the same as the FPL player ID for players active in the current season.

- **PlayerAttributes:** Attributes for each player in every gameweek of each season. The main attributes are FPL price, FPL position, and the team the player plays for.
- **PlayerAttributes:** Attributes for each player in every gameweek of each season. The main attributes are FPL price, FPL position, and the team the player plays for.

- **PlayerScore:** Stats for each player in each match. These include points scored, goals scored and condeded, assists, bonus points, minutes played and a few others. Only contains the stats available from the FPL API, we don't currently have other stats (like xG).

Expand Down Expand Up @@ -70,7 +70,7 @@ It does the following:

You should always run `airsenal_update_db --noattr` after an initial database setup to get the latest status of your FPL team (which is not done as part of `airsenal_setup_initial_db`). Giving the `--noattr` flag means player attributes will not be updated, which is not needed if you have just setup the database (as FPL player attributes can only change once per day).

Note we don't currently have a way to update the list of currently active _players_ (only their attributes). This unfortunately means that if a new player is added to the game the whole database needs to be recreated. It's therefore best to follow the initial database setup steps above at the start of every gameweek.
Note we don't currently have a way to update the list of currently active _players_ (only their attributes). This unfortunately means that if a new player is added to the game the whole database needs to be recreated. It's therefore best to follow the initial database setup steps above at the start of every gameweek.

### Data Sanity Checks

Expand Down Expand Up @@ -109,7 +109,7 @@ First:
- Predict the probability of each number of goals scored and conceded for each team in each fixture in the gameweek to consider, using the team model.
- Get the number of minutes each player played in the last three fixtures, and their current injury and suspension status.

Then calculate the different points contributions as below:
Then calculate the different points contributions as below:

**Recent Minutes and Appearance Points:**

Expand Down Expand Up @@ -144,7 +144,7 @@ The following is done in `get_defending_points()` in `airsenal.framework.predict

**Final Prediction:**

See `calc_predicted_points()` in `airsenal.framework.prediction_utils`.
See `calc_predicted_points()` in `airsenal.framework.prediction_utils`.

The final points prediction for each player in a fixture is the sum of their predicted appearance points, attacking points and defending points (averaged across the different predictions for the different number of minutes the player might play). The predicted points for a player in a _gameweek_ is the sum of their predicted points in all their team's fixtures in that gameweek - which may be two for double gameweeks (or none in blank gameweeks).

Expand Down Expand Up @@ -235,7 +235,7 @@ player_id, gameweek, predicted_score, method
(the method column allows us to have more than one predicted score per
player per gameweek, and add more later, without having to add more columns.
We now have a gameweek column rather than a fixture_id column - in double gameweeks
the player can have more than one fixture in a gameweek - the score we show is the
the player can have more than one fixture in a gameweek - the score we show is the
sum of both.)
```
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ Build the docker-image:
$ docker build -t airsenal .
```

If `docker build` fails due to a `RuntimeError` like
If `docker build` fails due to a `RuntimeError` like

```console
Unable to find installation candidates for jaxlib (0.4.11)
```

this may be a lack of maintained versions of a package for `m1` on Linux.

A slow solution for this error is to force a `linux/amd64` build like
A slow solution for this error is to force a `linux/amd64` build like

```console
$ docker build --platform linux/amd64 -t airsenal .
```

If that fails try
If that fails try

```console
$ docker build --platform linux/amd64 --no-cache -t airsenal .
Expand All @@ -101,7 +101,7 @@ Run commands with your configuration as environment variables, eg:
$ docker run -it --rm -v airsenal_data:/tmp/ -e "FPL_TEAM_ID=<your_id>" -e "AIRSENAL_HOME=/tmp" airsenal bash
```

or
or

```console
$ docker run -it --rm -v airsenal_data:/tmp/ -e "FPL_TEAM_ID=<your_id>" -e "AIRSENAL_HOME=/tmp" airsenal airsenal_run_pipeline
Expand Down
2 changes: 1 addition & 1 deletion airsenal/data/FPL_1718.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/FPL_1819.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/FPL_1920.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/FPL_2021.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/FPL_2122.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/FPL_2223.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/Replay_2122_GW1_GW38_202210071157.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/airsenal_gw_2021.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/airsenal_gw_2122.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/airsenal_gw_2223.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/airsenal_history_2021.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/airsenal_history_2122.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airsenal/data/airsenal_history_2223.json

Large diffs are not rendered by default.

Loading

0 comments on commit 24d5169

Please sign in to comment.