Skip to content

Commit 7d67506

Browse files
committed
FIX: allow to import from residual_conformity_scores
1 parent 9a0f359 commit 7d67506

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from .bounds import ( # noqa: F401
2+
AbsoluteConformityScore, GammaConformityScore, ResidualNormalisedScore
3+
)
4+
5+
import warnings
6+
warnings.warn(
7+
"Imports from mapie.conformity_scores.residual_conformity_scores " +
8+
"are deprecated. Please use from mapie.conformity_scores",
9+
DeprecationWarning
10+
)

mapie/tests/test_common.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,16 @@ def test_sklearn_compatible_estimator(
195195
) -> None:
196196
"""Check compatibility with sklearn, using sklearn estimator checks API."""
197197
check(estimator)
198+
199+
200+
def test_warning_when_import_from_residual_conformity_score():
201+
"""Check that a DepreciationWarning is raised when importing from
202+
mapie.conformity_scores.residual_conformity_scores"""
203+
204+
with pytest.warns(
205+
DeprecationWarning, match=r".*Imports from mapie.conformity_scores.*"
206+
):
207+
from mapie.conformity_scores.residual_conformity_scores import (
208+
GammaConformityScore
209+
)
210+
GammaConformityScore()

0 commit comments

Comments
 (0)