diff --git a/docs/examples/modelling/plot_classifier_bettor.py b/docs/examples/modelling/plot_classifier_bettor.py index 34561d9..4d2cd85 100644 --- a/docs/examples/modelling/plot_classifier_bettor.py +++ b/docs/examples/modelling/plot_classifier_bettor.py @@ -13,6 +13,7 @@ from sklearn.model_selection import TimeSeriesSplit, cross_val_score from sklearn.neighbors import KNeighborsClassifier from sklearn.pipeline import make_pipeline + from sportsbet.datasets import SoccerDataLoader from sportsbet.evaluation import ClassifierBettor, backtest diff --git a/src/sportsbet/datasets/_soccer/_data.py b/src/sportsbet/datasets/_soccer/_data.py index 9315ab9..232e603 100644 --- a/src/sportsbet/datasets/_soccer/_data.py +++ b/src/sportsbet/datasets/_soccer/_data.py @@ -22,9 +22,7 @@ MODELLING_URL = 'https://github.com/georgedouzas/sports-betting/tree/data/data/soccer/modelling' TRAINING_URL = 'https://raw.githubusercontent.com/georgedouzas/sports-betting/data/data/soccer/modelling/{league}_{division}_{year}.csv' -FIXTURES_URL = ( - 'https://raw.githubusercontent.com/georgedouzas/sports-betting/data/data/soccer/modelling/fixtures.csv' -) +FIXTURES_URL = 'https://raw.githubusercontent.com/georgedouzas/sports-betting/data/data/soccer/modelling/fixtures.csv' class SoccerDataLoader(_BaseDataLoader): diff --git a/tests/cli/test_bettor.py b/tests/cli/test_bettor.py index 322183a..e02594e 100644 --- a/tests/cli/test_bettor.py +++ b/tests/cli/test_bettor.py @@ -1,6 +1,7 @@ """Test the bettor commands.""" import pytest + from sportsbet.cli import main diff --git a/tests/cli/test_dataloader.py b/tests/cli/test_dataloader.py index 854cdb1..12018e3 100644 --- a/tests/cli/test_dataloader.py +++ b/tests/cli/test_dataloader.py @@ -1,6 +1,7 @@ """Test the dataloader commands.""" import pytest + from sportsbet.cli import main diff --git a/tests/cli/test_main.py b/tests/cli/test_main.py index 34372e5..48c63e5 100644 --- a/tests/cli/test_main.py +++ b/tests/cli/test_main.py @@ -1,6 +1,7 @@ """Test the main commands.""" import pytest + from sportsbet.cli import main diff --git a/tests/conftest.py b/tests/conftest.py index c355561..2f6e3fe 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,7 @@ def pandas_terminal_width() -> None: # noqa: PT004 pd.set_option('display.max_columns', 1000) -@pytest.fixture() +@pytest.fixture def cli_config_path(tmp_path: Path) -> Path: """Create configuration file.""" with Path.open(tmp_path / 'config.py', 'wt') as config_file: diff --git a/tests/datasets/test_dummy.py b/tests/datasets/test_dummy.py index 14e2a27..cbadb6e 100644 --- a/tests/datasets/test_dummy.py +++ b/tests/datasets/test_dummy.py @@ -7,6 +7,7 @@ import pandas as pd import pytest from sklearn.model_selection import ParameterGrid + from sportsbet.datasets import DummySoccerDataLoader diff --git a/tests/evaluation/__init__.py b/tests/evaluation/__init__.py index 9127903..85717f3 100644 --- a/tests/evaluation/__init__.py +++ b/tests/evaluation/__init__.py @@ -4,10 +4,11 @@ import numpy as np import pandas as pd +from typing_extensions import Self + from sportsbet import Data from sportsbet.datasets import DummySoccerDataLoader from sportsbet.evaluation._base import _BaseBettor -from typing_extensions import Self X_train, Y_train, O_train = DummySoccerDataLoader().extract_train_data(odds_type='williamhill') diff --git a/tests/evaluation/test_base.py b/tests/evaluation/test_base.py index c95145c..d4631ac 100644 --- a/tests/evaluation/test_base.py +++ b/tests/evaluation/test_base.py @@ -6,8 +6,8 @@ import pandas as pd import pytest from sklearn.exceptions import NotFittedError -from sportsbet.evaluation._base import _BaseBettor +from sportsbet.evaluation._base import _BaseBettor from tests.evaluation import O_train, TestBettor, X_train, Y_train diff --git a/tests/evaluation/test_classifier.py b/tests/evaluation/test_classifier.py index 213950a..00e5c46 100644 --- a/tests/evaluation/test_classifier.py +++ b/tests/evaluation/test_classifier.py @@ -5,6 +5,7 @@ from sklearn.dummy import DummyClassifier, DummyRegressor from sklearn.exceptions import NotFittedError from sklearn.utils.validation import check_is_fitted + from sportsbet.datasets import DummySoccerDataLoader from sportsbet.evaluation import ClassifierBettor diff --git a/tests/evaluation/test_model_selection.py b/tests/evaluation/test_model_selection.py index 84bddb7..1ef06e8 100644 --- a/tests/evaluation/test_model_selection.py +++ b/tests/evaluation/test_model_selection.py @@ -8,8 +8,8 @@ import pytest from sklearn.dummy import DummyClassifier from sklearn.model_selection import KFold, TimeSeriesSplit -from sportsbet.evaluation import BettorGridSearchCV, ClassifierBettor, OddsComparisonBettor, backtest +from sportsbet.evaluation import BettorGridSearchCV, ClassifierBettor, OddsComparisonBettor, backtest from tests.evaluation import O_train, TestBettor, X_train, Y_train diff --git a/tests/evaluation/test_rules.py b/tests/evaluation/test_rules.py index 0569f1f..aa329b3 100644 --- a/tests/evaluation/test_rules.py +++ b/tests/evaluation/test_rules.py @@ -2,6 +2,7 @@ import numpy as np import pytest + from sportsbet.datasets import DummySoccerDataLoader from sportsbet.evaluation import OddsComparisonBettor