Skip to content

Commit 45c9b97

Browse files
author
mvargas33
committed
Minor flake8 fix
1 parent 1d752f7 commit 45c9b97

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test_bilinear_mixin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from numpy.testing import assert_array_almost_equal
55
import pytest
66
from metric_learn._util import make_context
7-
from sklearn import clone
87
from sklearn.cluster import DBSCAN
98

9+
1010
class IdentityBilinearMixin(BilinearMixin):
1111
"""A simple Identity bilinear mixin that returns an identity matrix
1212
M as learned. Can change M for a random matrix calling random_M.
@@ -55,6 +55,7 @@ def test_check_correctness_similarity():
5555
assert_array_almost_equal(dist1, desired) # score_pairs
5656
assert_array_almost_equal(dist2, desired) # get_metric
5757

58+
5859
def test_check_handmade_example():
5960
u = np.array([0, 1, 2])
6061
v = np.array([3, 4, 5])
@@ -104,8 +105,8 @@ def test_score_pairs_dim():
104105
assert mixin.score_pairs(tuples).shape == (tuples.shape[0],)
105106
context = make_context(mixin)
106107
msg = ("3D array of formed tuples expected{}. Found 2D array "
107-
"instead:\ninput={}. Reshape your data and/or use a preprocessor.\n"
108-
.format(context, tuples[1]))
108+
"instead:\ninput={}. Reshape your data and/or use a preprocessor.\n"
109+
.format(context, tuples[1]))
109110
with pytest.raises(ValueError) as raised_error:
110111
mixin.score_pairs(tuples[1])
111112
assert str(raised_error.value) == msg
@@ -122,4 +123,4 @@ def test_check_scikitlearn_compatibility():
122123
n = 100
123124
X = np.array([np.random.rand(d) for i in range(n)])
124125
clustering = DBSCAN(metric=mixin.get_metric())
125-
clustering.fit(X)
126+
clustering.fit(X)

0 commit comments

Comments
 (0)