Skip to content

Commit 79ba0f8

Browse files
committed
FIX: add ConformityScore to have no breakning changes
1 parent 7d67506 commit 79ba0f8

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from .regression import BaseRegressionScore as ConformityScore # noqa: F401
2+
3+
import warnings
4+
warnings.warn(
5+
"Conformity score class is depreciated. Prefer import " +
6+
"BaseRegressionScore from mapie.conformity_scores",
7+
DeprecationWarning
8+
)

mapie/tests/test_common.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
X_toy = np.arange(18).reshape(-1, 1)
1818
y_toy = np.array(
1919
[0, 0, 1, 0, 1, 2, 1, 2, 2, 0, 0, 1, 0, 1, 2, 1, 2, 2]
20-
)
20+
)
2121

2222

2323
def MapieSimpleEstimators() -> List[BaseEstimator]:
@@ -208,3 +208,15 @@ def test_warning_when_import_from_residual_conformity_score():
208208
GammaConformityScore
209209
)
210210
GammaConformityScore()
211+
212+
213+
def test_warning_when_import_from_conformity_scores():
214+
"""Check that a DepreciationWarning is raised when importing from
215+
mapie.conformity_scores.conformity_score"""
216+
217+
with pytest.warns(
218+
DeprecationWarning, match=r".*Conformity score class is depreciated.*"
219+
):
220+
from mapie.conformity_scores.conformity_scores import ( # noqa: F401
221+
ConformityScore
222+
)

0 commit comments

Comments
 (0)