Skip to content

Commit 54c9d89

Browse files
wdevazelhesbellet
authored andcommitted
make check_preprocessor private (#235)
1 parent 09dcd56 commit 54c9d89

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

metric_learn/base_metric.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def score_pairs(self, pairs):
5151
learner is.
5252
"""
5353

54-
def check_preprocessor(self):
54+
def _check_preprocessor(self):
5555
"""Initializes the preprocessor"""
5656
if _is_arraylike(self.preprocessor):
5757
self.preprocessor_ = ArrayIndexer(self.preprocessor)
@@ -92,7 +92,7 @@ def _prepare_inputs(self, X, y=None, type_of_inputs='classic',
9292
y: `numpy.ndarray` (optional)
9393
The checked input labels array.
9494
"""
95-
self.check_preprocessor()
95+
self._check_preprocessor()
9696
return check_input(X, y,
9797
type_of_inputs=type_of_inputs,
9898
preprocessor=self.preprocessor_,

test/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ class MockMetricLearner(MahalanobisMixin):
779779

780780
mock_algo = MockMetricLearner(preprocessor=preprocessor)
781781
with pytest.raises(ValueError) as e:
782-
mock_algo.check_preprocessor()
782+
mock_algo._check_preprocessor()
783783
assert str(e.value) == ("Invalid type for the preprocessor: {}. You should "
784784
"provide either None, an array-like object, "
785785
"or a callable.".format(type(preprocessor)))
@@ -812,7 +812,7 @@ def test_error_message_t_score_pairs(estimator, _):
812812
"""
813813
estimator = clone(estimator)
814814
set_random_state(estimator)
815-
estimator.check_preprocessor()
815+
estimator._check_preprocessor()
816816
triplets = np.array([[[1.3, 6.3], [3., 6.8], [6.5, 4.4]],
817817
[[1.9, 5.3], [1., 7.8], [3.2, 1.2]]])
818818
with pytest.raises(ValueError) as raised_err:

0 commit comments

Comments
 (0)