Skip to content

Commit

Permalink
Merge pull request #26 from anguswilliams91/update-deps
Browse files Browse the repository at this point in the history
Update deps
  • Loading branch information
nbarlowATI authored Mar 22, 2024
2 parents fcd023b + aaf7c88 commit e03aab4
Show file tree
Hide file tree
Showing 12 changed files with 323 additions and 422 deletions.
1 change: 1 addition & 0 deletions bpl/_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Private utility functions."""

from typing import Iterable, Optional, Tuple, Union

import jax
Expand Down
1 change: 1 addition & 0 deletions bpl/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of the probabilistic model for soccer matches."""

from __future__ import annotations

from abc import abstractmethod
Expand Down
1 change: 1 addition & 0 deletions bpl/dixon_coles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of a simple team level model."""

from __future__ import annotations

from typing import Any, Dict, Iterable, Optional, Tuple, Union
Expand Down
1 change: 1 addition & 0 deletions bpl/dynamic_dixon_coles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of the neutral model with dynamic parameters in the current version of bpl."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions bpl/extended_dixon_coles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of the model in the current version of bpl."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions bpl/neutral_dixon_coles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of the neutral model for predicting the World Cup."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions bpl/neutral_dixon_coles_WC.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of the neutral model for predicting the World Cup."""

from __future__ import annotations

import warnings
Expand Down
715 changes: 302 additions & 413 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[tool.poetry]
name = "bpl"
version = "0.2.0"
version = "0.3.0"
description = ""
authors = ["Angus Williams <[email protected]>"]

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
numpyro = "^0.12.1"
scipy = "^1.11.1"
python = "^3.9"
numpyro = "^0.13.2"
scipy = "^1.12.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
black = "^23.7.0"
isort = "^5.12.0"
pytest = "^8.0.1"
black = "^24.2.0"
isort = "^5.13.2"
pytest-cov = "^4.1.0"
pylint = "^2.17.4"
pylint = "^3.0.4"

[tool.isort]
profile = "black"
Expand Down
1 change: 1 addition & 0 deletions tests/test_all_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Shared tests across all models, e.g. checking probabilities are valid."""

import jax.numpy as jnp
import pytest

Expand Down
1 change: 1 addition & 0 deletions tests/test_neutral_dixon_coles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

TOL = 1e-02


@pytest.fixture
def model(neutral_dummy_data):
return NeutralDixonColesMatchPredictor().fit(neutral_dummy_data)
Expand Down
5 changes: 4 additions & 1 deletion tests/test_neutral_dixon_coles_WC.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

TOL = 5e-02


@pytest.fixture
def model(neutral_dummy_data):
return NeutralDixonColesMatchPredictorWC().fit(neutral_dummy_data)
Expand Down Expand Up @@ -97,7 +98,9 @@ def test_predict_concede_n_proba(model):
assert len(proba_team_concede) == 1
assert (proba_team_concede[0] >= 0) and (proba_team_concede[0] <= 1)

proba_opponent_score = model.predict_score_n_proba(1, "1", "0", "0", "1", home=False)
proba_opponent_score = model.predict_score_n_proba(
1, "1", "0", "0", "1", home=False
)
assert proba_team_concede.tolist() == pytest.approx(
proba_opponent_score.tolist(), abs=TOL
)
Expand Down

0 comments on commit e03aab4

Please sign in to comment.