Skip to content

Commit 2bb7c46

Browse files
Martin EastwoodMartin Eastwood
authored andcommitted
general refactoring and updated examples
1 parent 739e2c5 commit 2bb7c46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+8404
-10757
lines changed

.coveragerc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[run]
2+
omit =
3+
tests/*
4+
penaltyblog/fpl/*

.github/workflows/coverage.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Coverage
2+
on:
3+
push:
4+
branches: [ master ]
5+
6+
jobs:
7+
coverage:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v4
12+
with:
13+
python-version: "3.x"
14+
- name: Install dependencies
15+
run: |
16+
pip install pytest pytest-cov
17+
pip install -e .[dev]
18+
- name: Run tests with coverage
19+
run: pytest --cov --cov-report=xml
20+
- name: Upload coverage reports to Codecov
21+
uses: codecov/codecov-action@v5
22+
with:
23+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/p/your-package-name
13+
permissions:
14+
id-token: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.x"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build
26+
- name: Build package
27+
run: python -m build
28+
- name: Publish package
29+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install .[dev]
26+
- name: Run tests
27+
run: pytest

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
test:
44
coverage run -m pytest
5+
coverage report -m
56

67
test_subset:
7-
pytest -v test/test_backtest.py
8+
pytest -v test/test_kelly_criterion.py
89

910
coverage:
1011
coverage run -m pytest

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
</div>
1414

1515

16+
<div align="center">
17+
<img src="logo.png" alt="Penalty Blog Logo" width="200">
18+
</div>
19+
20+
21+
1622
The **penaltyblog** Python package contains lots of useful code from [pena.lt/y/blog](http://pena.lt/y/blog.html) for working with football (soccer) data.
1723

1824
**penaltyblog** includes functions for:

docs/changelog/index.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ Version Numbering
77
`penaltyblog` follows the SemVer versioning guidelines. For more information,
88
see `semver.org <http://semver.org/>`_
99

10+
v0.9.0 (xxxx-xx-xx)
11+
^^^^^^^^^^^^^^
12+
- Removed pymc as a dependency
13+
- Updated dependency versions
14+
- Added support for Python 3.13
15+
- Rewrote Bayesian Hierarchical model into Stan instead of pymc and updated prediction method to integtate over the posterior rather than just sampling the mid-point
16+
- Rewrote Bayesian Random Intercept model into Stan instead of pymc, updated model to use a more accurate random intercept, and updated prediction method to integtate over the posterior rather than just sampling the mid-point
17+
- Rewrote Bayesian Bivariate model into Stan instead of pymc, improved model so converges better, and updated prediction method to integtate over the posterior rather than just sampling the mid-point
18+
- Removed obsolete sofifa and espn scrapers
19+
- Optimised RPS calculation
20+
- Optimised ELO code
21+
- Refactored Kelly Criterion code
22+
- Updated FootballProbabilityGrid to store its internal matrix as a numpy array
23+
- Updated all examples
24+
- Increased unit test coverage
25+
- Added CI/CD
26+
- Removed Poetry from build step
27+
- Updated documentation
1028

1129
v0.8.1 (2023-09-31)
1230
^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)