Skip to content

Commit 9ddd060

Browse files
Update tox.ini packages version
1 parent 78b11b9 commit 9ddd060

File tree

7 files changed

+32
-34
lines changed

7 files changed

+32
-34
lines changed

frouros/callbacks/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ def set_detector(self, detector) -> None:
5757
# )
5858
# self._detector = value
5959

60-
def on_fit_start(self, X: np.ndarray) -> None: # noqa: N803
60+
def on_fit_start(self, X: np.ndarray) -> None: # noqa: N803, B027
6161
"""On fit start method.
6262
6363
:param X: reference data
6464
:type X: numpy.ndarray
6565
"""
6666

67-
def on_fit_end(self, X: np.ndarray) -> None: # noqa: N803
67+
def on_fit_end(self, X: np.ndarray) -> None: # noqa: N803, B027
6868
"""On fit end method.
6969
7070
:param X: reference data

frouros/datasets/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def __repr__(self) -> str:
175175
)
176176

177177

178-
class BaseDatasetGenerator(abc.ABC):
178+
class BaseDatasetGenerator(abc.ABC): # noqa: B024
179179
"""Abstract class representing a dataset generator."""
180180

181181
def __init__(self, seed: Optional[int] = None) -> None:

frouros/detectors/concept_drift/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from frouros.utils.checks import check_callbacks
1010

1111

12-
class BaseConceptDriftConfig(abc.ABC):
12+
class BaseConceptDriftConfig(abc.ABC): # noqa: B024
1313
"""Abstract class representing a concept drift configuration class."""
1414

1515
def __init__(

frouros/detectors/concept_drift/streaming/statistical_process_control/eddm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ def _update(self, value: Union[int, float], **kwargs) -> None:
367367
self.num_instances
368368
>= self.config.min_num_misclassified_instances # type: ignore
369369
):
370-
371370
distance_threshold = (
372371
self.mean_distance_error
373372
+ self.config.level * self.std_distance_error # type: ignore

frouros/detectors/data_drift/batch/statistical_test/chisquare.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""ChiSquareTest (Chi-square test) module."""
22

33
import collections
4-
from typing import Optional, Tuple, Union
4+
import typing
5+
from typing import Optional, Set, Tuple, Union
56

67
import numpy as np # type: ignore
78
from scipy.stats import chi2_contingency # type: ignore
@@ -77,19 +78,20 @@ def _statistical_test(
7778
return test
7879

7980
@staticmethod
81+
@typing.no_type_check # FIXME: X_ref_counter and X_counter cause mypy errors
8082
def _calculate_frequencies(
8183
X_ref: np.ndarray, # noqa: N803
8284
X: np.ndarray,
8385
) -> Tuple[list[int], list[int]]:
8486
X_ref_counter, X_counter = [ # noqa: N806
8587
*map(collections.Counter, [X_ref, X]) # noqa: N806
8688
]
87-
possible_values = set([*X_ref_counter.keys()] + [*X_counter.keys()])
89+
possible_values: Set[str] = set(
90+
[*X_ref_counter.keys()] + [*X_counter.keys()]
91+
) # noqa: N806
8892
f_exp, f_obs = {}, {}
8993
for value in possible_values:
90-
f_exp[value] = X_ref_counter.get(value, 0)
91-
f_obs[value] = X_counter.get(value, 0)
92-
f_exp_values, f_obs_values = [
93-
*map(list, [f_exp.values(), f_obs.values()]) # type: ignore
94-
]
95-
return f_exp_values, f_obs_values # type: ignore
94+
f_exp[value] = X_ref_counter.get(value, 0) # noqa: N806
95+
f_obs[value] = X_counter.get(value, 0) # noqa: N806
96+
f_exp_values, f_obs_values = [*map(list, [f_exp.values(), f_obs.values()])]
97+
return f_exp_values, f_obs_values

frouros/tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ def train_prediction_normal(
389389

390390

391391
@pytest.fixture(scope="module", name="dataset_simple")
392-
def concept_drift_dataset_simple() -> Tuple[
393-
Tuple[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]
394-
]:
392+
def concept_drift_dataset_simple() -> (
393+
Tuple[Tuple[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]]
394+
):
395395
"""Dataset with multiple concepts to induce concept drift.
396396
397397
:return: dataset split in reference and test

tox.ini

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
minversion = 3.24.5
2+
minversion = 4.12.0
33
envlist =
44
py3{9, 10, 11, 12}
55
linters
@@ -21,10 +21,10 @@ python =
2121
# Force to upgrade pip/wheel/setuptools to the latest version
2222
download = True
2323
deps =
24-
pytest>=7.2.1,<7.3
25-
pytest-cov>=4.0.0,<4.1
26-
pytest-mock>=3.10.0<3.11
27-
scikit-learn>=1.2.0<1.3
24+
pytest>=7.4.4,<7.5
25+
pytest-cov>=4.1.0,<4.2
26+
pytest-mock>=3.12.0,<3.13
27+
scikit-learn>=1.3.2,<1.4
2828
commands = pytest --cov={[base]package} \
2929
--cov-report term \
3030
--cov-report=xml
@@ -33,7 +33,7 @@ commands = pytest --cov={[base]package} \
3333
basepython = {[base]python}
3434
skip_install = {[base]skip_install}
3535
deps =
36-
black>=22.3,<22.4
36+
black>=23.12.1,<24.0
3737
commands = black --check --diff {[base]package}
3838

3939
[flake8]
@@ -53,28 +53,25 @@ exclude =
5353
.venv,
5454
.env
5555
max-complexity = 10
56-
format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
5756

5857
[testenv:flake8]
5958
basepython = {[base]python}
6059
skip_install = {[base]skip_install}
6160
deps =
62-
flake8>=4.0,<4.1
63-
flake8-bugbear>=22.3,<22.4
64-
flake8-docstrings>=1.6,<1.7
65-
flake8-typing-imports>=1.12,<1.13
66-
flake8-colors>=0.1,<0.2
67-
pep8-naming>=0.12,<0.13
68-
pydocstyle>=6.1,<6.2
61+
flake8>=7.0.0,<8.0
62+
flake8-bugbear>=23.12.2,<24.0
63+
flake8-docstrings>=1.7.0,<1.8
64+
flake8-typing-imports>=1.15.0,<1.16
65+
pep8-naming>=0.13.3,<0.14
66+
pydocstyle>=6.3.0,<6.4
6967
commands = flake8
7068

7169
[testenv:mypy]
7270
basepython = {[base]python}
7371
skip_install = {[base]skip_install}
7472
deps =
75-
# FIXME: 0.971 version generates new unhandled warnings
76-
mypy>=0.941,<0.971
77-
types-requests
73+
mypy>=1.8.0,<1.9
74+
types-requests>=2.31.0,<2.32
7875
plugins = numpy.typing.mypy_plugin
7976
commands = mypy {[base]package}
8077

@@ -86,7 +83,7 @@ norecursedirs = docs
8683
basepython = {[base]python}
8784
skip_install = {[base]skip_install}
8885
deps =
89-
pylint>=2.12,<2.13
86+
pylint>=3.0.3,<3.1.0
9087
commands =
9188
pylint {[base]package} --good-names=b,d,df,e,f,h,i,j,m,n,p,w,x,y,z,r,X,en,js,kl,XY_chunks_combinations,X_chunks,X_chunks_combinations,X_concat,X_counter,X_extra,X_fold_test,X_fold_train,X_hist,X_merge,X_new_context,X_new_ref,X_num_samples,X_queue,X_sorted,X_percents,X_permuted,X_permuted_num_samples,X_permuted_,X_permuted_concat,X_permuted_ref_,X_permuted_ref_num_samples,X_preprocessed,X_ref,X_ref_hist,X_ref_counter,X_ref_percents,X_ref_rvs,X_ref_rv_histogram,X_rvs,X_rv_histogram,X_ref,_X_ref,X_ref_num_samples,X_ref_univariate,X_ref_multivariate,X_sample,X_samples,X_test,X_test_univariate,X_test_multivariate,X_train,y,Y,Y_chunks,Y_chunks_copy,Y_chunks_combinations,Y_hist,Y_percents,Y_num_samples,_X_num_samples --disable=too-many-instance-attributes,consider-using-with,too-few-public-methods --ignore-comments=yes --ignore-docstrings=yes --ignore-imports=yes --max-args=7 --min-similarity-lines=13 --extension-pkg-whitelist=scipy.special
9289

0 commit comments

Comments
 (0)