Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = ["diskcache==5.6.3", "setuptools>=70.0.0"]
Expand Down Expand Up @@ -65,7 +66,7 @@ dependencies = [
"pytest==7.4.2",
"pytest-cov==4.1.0",
"build",
"cython==3.0.0",
"cython==3.0.12",
"faker",
"tqdm",
"pdbpp",
Expand All @@ -75,7 +76,7 @@ dependencies = [


[[tool.hatch.envs.test.matrix]]
python = ["310", "311", "312"]
python = ["310", "311", "312", "3.13"]

[tool.coverage.run]
branch = true
Expand Down Expand Up @@ -115,7 +116,7 @@ dependencies = [
"pyinstrument", "benchmarker" , "numpy", "tqdm"
]
[[tool.hatch.envs.benchmark.matrix]]
python = [ "310", "311", "312"]
python = [ "310", "311", "312", "313"]

[tool.hatch.envs.benchmark.scripts]

Expand Down
22 changes: 22 additions & 0 deletions tests/test_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,25 @@ def test_ranked_search_example_long(ranked_cosine_long_searcher, query, threshol
])
def test_ranked_search_jaccard(ranked_jaccard_searcher, query, threshold, expected_results):
assert ranked_jaccard_searcher.ranked_search(query, threshold) == expected_results


def test_deteminism():
db = DictDatabase(CharacterNgramFeatureExtractor(2))
db.add("fo")
db.add("foo")
db.add("fooo")
db.add("foooo")
db.add("fooooo")
db.add("foooooo")
db.add("fooooooo")
db.add("foooooooo")
db.add("fooooooooo")
db.add("foooooooooo")
db.add("fooooooooooo")
db.add("foooooooooooo")
db.add("fooooooooooooo")
db.add("foooooooooooooo")
db.add("fooooooooooooooo")
searcher = Searcher(db, CosineMeasure())
result = searcher.search("foo", 0.8)
# breakpoint()