Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix linter #4035

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 30 additions & 19 deletions tests/test_contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,34 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

import faiss
import unittest
import numpy as np
import platform
import os
import random
import platform
import shutil
import tempfile
import unittest
from contextlib import contextmanager

from faiss.contrib import datasets
from faiss.contrib import inspect_tools
from faiss.contrib import evaluation
from faiss.contrib import ivf_tools
from faiss.contrib import clustering
from faiss.contrib import big_batch_search
from faiss.contrib.ondisk import merge_ondisk
import faiss
import numpy as np

from common_faiss_tests import get_dataset_2
from faiss.contrib.exhaustive_search import \
knn_ground_truth, knn, range_ground_truth, \
range_search_max_results, exponential_query_iterator
from contextlib import contextmanager

from faiss.contrib import (
big_batch_search,
clustering,
datasets,
evaluation,
inspect_tools,
ivf_tools,
)
from faiss.contrib.exhaustive_search import (
exponential_query_iterator,
knn,
knn_ground_truth,
range_ground_truth,
range_search_max_results,
)
from faiss.contrib.ondisk import merge_ondisk


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

def test_hnsw_permute(self):
""" make sure HNSW permutation works (useful when used as coarse quantizer) """
"""
make sure HNSW permutation works
(useful when used as coarse quantizer)
"""
ds = datasets.SyntheticDataset(32, 0, 1000, 50)
index = faiss.index_factory(ds.d, "HNSW32,Flat")
index.add(ds.get_database())
Expand Down Expand Up @@ -692,8 +701,10 @@ def test_code_set(self):
np.sort(codes[inserted], axis=None))


@unittest.skipIf(platform.system() == 'Windows',
'OnDiskInvertedLists is unsupported on Windows.')
@unittest.skipIf(
platform.system() == 'Windows',
'OnDiskInvertedLists is unsupported on Windows.'
)
class TestMerge(unittest.TestCase):
@contextmanager
def temp_directory(self):
Expand Down
Loading