From b608101a195a31619ad0ca7f96f2a14058da1295 Mon Sep 17 00:00:00 2001 From: Dax Pryce Date: Thu, 24 Oct 2024 18:04:19 +0000 Subject: [PATCH] The unit test for the new feature is fixed, but the static memory tests around filtered indices is sporadically failing. This is new! And exciting! But also unexpected! --- python/tests/test_files.py | 2 +- python/tests/test_static_memory_index.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/python/tests/test_files.py b/python/tests/test_files.py index 3eb654fd0..d3f6914c0 100644 --- a/python/tests/test_files.py +++ b/python/tests/test_files.py @@ -28,7 +28,7 @@ def test_memmap(self): vecs_file_copy = tempfile.NamedTemporaryFile(delete=False) atexit.register(Path(vecs_file_copy.name).unlink) shutil.copyfile(vecs_file, vecs_file_copy.name) - + actual = dap.vectors_from_file( vecs_file, dtype=np.float32, diff --git a/python/tests/test_static_memory_index.py b/python/tests/test_static_memory_index.py index fe571be5d..e4662ad4b 100644 --- a/python/tests/test_static_memory_index.py +++ b/python/tests/test_static_memory_index.py @@ -306,6 +306,8 @@ def test_exhaustive_validation(self): with_filter_but_label_all, _ = index.search( query_vectors[0], k_neighbors=k*2, complexity=128, filter_label="all" ) + # this has begun failing randomly. gopalrs - this *shouldn't* fail, but for some reason the filtered search + # will sometimes return fewer than the expected 10k results here. intersection = np.intersect1d(without_filter, with_filter_but_label_all) intersect_count = intersection.shape[0] self.assertEqual(intersect_count, k*2)