From 2930a98455bc69297d2c1ee65308af6f0a390d81 Mon Sep 17 00:00:00 2001 From: Ruben Menke Date: Tue, 6 May 2025 14:14:28 +0200 Subject: [PATCH] updating --- pyproject.toml | 7 ++++--- tests/test_searcher.py | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3ff270b..7fad644 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] @@ -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", @@ -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 @@ -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] diff --git a/tests/test_searcher.py b/tests/test_searcher.py index bca5881..bb426f8 100644 --- a/tests/test_searcher.py +++ b/tests/test_searcher.py @@ -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() \ No newline at end of file