Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jack89roberts committed Feb 24, 2024
1 parent 85f30cc commit aaf7c88
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 1 deletion.
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
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 aaf7c88

Please sign in to comment.