Skip to content

Commit a22e5b1

Browse files
committed
deprecation warning added
1 parent 2740f50 commit a22e5b1

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

hypex/aa.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import warnings
34
from typing import Any, Iterable
45

56
from .analyzers.aa import AAScoreAnalyzer, OneAAStatAnalyzer
@@ -199,7 +200,17 @@ def __init__(
199200
random_states: Iterable[int] | None = None,
200201
equal_variance: bool | None = None,
201202
groups_sizes: list[float] | None = None,
203+
**kwargs,
202204
):
205+
if "t_test_equal_var" in kwargs:
206+
warnings.warn(
207+
"t_test_equal_var is deprecated and will be removed in a future version. "
208+
"Use equal_variance instead.",
209+
DeprecationWarning,
210+
stacklevel=2,
211+
)
212+
if equal_variance is None:
213+
equal_variance = kwargs.pop("t_test_equal_var")
203214
if n_iterations is None:
204215
if precision_mode:
205216
n_iterations = 2000

hypex/ab.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import warnings
34
from typing import Literal
45

56
from .analyzers.ab import ABAnalyzer
@@ -148,6 +149,7 @@ def __init__(
148149
cuped_features: dict[str, str] | None = None,
149150
cupac_models: str | list[str] | None = None,
150151
enable_cupac: bool = False,
152+
**kwargs,
151153
):
152154
"""
153155
Args:
@@ -158,6 +160,15 @@ def __init__(
158160
cupac_models: str | list[str] — model name (e.g. 'linear', 'ridge', 'lasso', 'catboost') or list of model names to try. If None, all available models will be tried and the best will be selected by variance reduction.
159161
enable_cupac: bool — Enable CUPAC variance reduction. CUPAC configuration is extracted from dataset.features_mapping.
160162
"""
163+
if "t_test_equal_var" in kwargs:
164+
warnings.warn(
165+
"t_test_equal_var is deprecated and will be removed in a future version. "
166+
"Use equal_variance instead.",
167+
DeprecationWarning,
168+
stacklevel=2,
169+
)
170+
if equal_variance is None:
171+
equal_variance = kwargs.pop("t_test_equal_var")
161172
super().__init__(
162173
experiment=self._make_experiment(
163174
additional_tests,

0 commit comments

Comments
 (0)