Skip to content

Commit 2aa79eb

Browse files
junjieqifacebook-github-bot
authored andcommitted
fix linter (#4035)
Summary: same as title Differential Revision: D66154375
1 parent 94b640c commit 2aa79eb

1 file changed

Lines changed: 30 additions & 19 deletions

File tree

tests/test_contrib.py

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,34 @@
33
# This source code is licensed under the MIT license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
import faiss
7-
import unittest
8-
import numpy as np
9-
import platform
106
import os
11-
import random
7+
import platform
128
import shutil
139
import tempfile
10+
import unittest
11+
from contextlib import contextmanager
1412

15-
from faiss.contrib import datasets
16-
from faiss.contrib import inspect_tools
17-
from faiss.contrib import evaluation
18-
from faiss.contrib import ivf_tools
19-
from faiss.contrib import clustering
20-
from faiss.contrib import big_batch_search
21-
from faiss.contrib.ondisk import merge_ondisk
13+
import faiss
14+
import numpy as np
2215

2316
from common_faiss_tests import get_dataset_2
24-
from faiss.contrib.exhaustive_search import \
25-
knn_ground_truth, knn, range_ground_truth, \
26-
range_search_max_results, exponential_query_iterator
27-
from contextlib import contextmanager
17+
18+
from faiss.contrib import (
19+
big_batch_search,
20+
clustering,
21+
datasets,
22+
evaluation,
23+
inspect_tools,
24+
ivf_tools,
25+
)
26+
from faiss.contrib.exhaustive_search import (
27+
exponential_query_iterator,
28+
knn,
29+
knn_ground_truth,
30+
range_ground_truth,
31+
range_search_max_results,
32+
)
33+
from faiss.contrib.ondisk import merge_ondisk
2834

2935

3036
class TestComputeGT(unittest.TestCase):
@@ -664,7 +670,10 @@ def test_sort(self):
664670
np.testing.assert_equal(Inew, Iref)
665671

666672
def test_hnsw_permute(self):
667-
""" make sure HNSW permutation works (useful when used as coarse quantizer) """
673+
"""
674+
make sure HNSW permutation works
675+
(useful when used as coarse quantizer)
676+
"""
668677
ds = datasets.SyntheticDataset(32, 0, 1000, 50)
669678
index = faiss.index_factory(ds.d, "HNSW32,Flat")
670679
index.add(ds.get_database())
@@ -692,8 +701,10 @@ def test_code_set(self):
692701
np.sort(codes[inserted], axis=None))
693702

694703

695-
@unittest.skipIf(platform.system() == 'Windows',
696-
'OnDiskInvertedLists is unsupported on Windows.')
704+
@unittest.skipIf(
705+
platform.system() == 'Windows',
706+
'OnDiskInvertedLists is unsupported on Windows.'
707+
)
697708
class TestMerge(unittest.TestCase):
698709
@contextmanager
699710
def temp_directory(self):

0 commit comments

Comments
 (0)