Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps #26

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading