Skip to content

Commit

Permalink
Flow test improvements (#585)
Browse files Browse the repository at this point in the history
* fix hnsw parallel tests

* update pyproject toml file
  • Loading branch information
GuyAv46 authored Dec 29, 2024
1 parent 63badf2 commit bcb3033
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ classifiers = [
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'License :: OSI Approved :: BSD License',
'Development Status :: 3 - Alpha',
]
Expand All @@ -28,8 +31,8 @@ python = "^3.10"
[tool.poetry.dev-dependencies]
numpy = "*"
hnswlib = "^0.6.2"
pytest = "^6.2.4"
scipy = "^1.10.1"
pytest = "^8.3"
scipy = "^1.14.1"
h5py = "^3.7.0"
ml_dtypes = "*"

Expand Down
6 changes: 3 additions & 3 deletions tests/flow/test_hnsw_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# Helper class for creating a "baseline" HNSW index that was built by inserting vectors one by one and a corresponding
# flat index for given params, to compare the parallel operation against it
class TestIndex:
class IndexTest:
def __init__(self, dim_, num_elements_, metric_, data_type_, multi_=False, ef_runtime=200):

self.dim = dim_
Expand Down Expand Up @@ -81,10 +81,10 @@ def compute_ground_truth_range(self, query_data, radius):
per_label = 5 # for multi value index

print("Creating test indexes...")
g_test_index = TestIndex(dim, num_elements, metric, data_type)
g_test_index = IndexTest(dim, num_elements, metric, data_type)
g_test_index.insert_random_vectors()

g_test_index_multi = TestIndex(dim, num_elements, metric, data_type, multi_=True)
g_test_index_multi = IndexTest(dim, num_elements, metric, data_type, multi_=True)
g_test_index_multi.insert_random_vectors_multi(per_label)

def test_parallel_search():
Expand Down

0 comments on commit bcb3033

Please sign in to comment.