Repository navigation
chore: merge main (v0.8.5) into dev/0.9 - #238
Merged
Merged
Conversation
Code PRs must be built and tested locally, including changes produced with automated tools, and contributors must respond to review. Claims on code issues state how the change will be verified; unanswered review feedback can lead to unassignment.
0.9 gives the three index classes one name for each concept (#232). This release accepts both spellings and raises a DeprecationWarning, at the caller's line, for the 0.8 one: - HnswIndex.capacity and reserve(num_points) for max_elements and resize; max_elements is deprecated on IvfIndex and SymqgIndex. - IvfIndex.reserve_cluster for reserve. - IvfIndex(routing=...) and the routing property for initializer. - search(queries, k, ef_search=...) for ef= on HnswIndex and SymqgIndex. - Search options after the breadth are keyword-only; positions warn. - nprobe=0 and ef_search=0 for the default warn; None selects it. - HnswIndex seeds above 2**32 - 1 warn. The extension keeps the 0.8 names, so the new ones are added in the Python layer, which 0.9 deletes when the extension itself is renamed. No 0.8 call changes its result or its exception type. The HnswIndex default seed and repr() are unchanged here; the 0.9 changes to them are announced in the new 0.8.5 release notes page, which also records #231.
A property assigned to a class after its creation does not get __set_name__, and before Python 3.13 it then reports errors without its name: assigning to the read-only routing property raised "property of 'IvfIndex' object has no setter". CI's wheel tests on CPython 3.11 caught this through test_new_members_are_named_after_their_class; the local environment is 3.13, where the name falls back to the getter's name. Call __set_name__ when adding the properties, so every supported Python names them.
feat(python): accept the 0.9 names and deprecate the 0.8 spellings
…lings 0.9 names the k-means parameters like the index parameters (#233). This release accepts both spellings and raises a DeprecationWarning, at the caller's line, for the 0.8 one: - QGKMeans and QGKMeansParameters take nbits (32, 4 or 8), max_degree and ef_construction for quantization_bits (0, 4 or 8), graph_degree and ef_build, as keywords and as attributes of cp. - final_assignment takes 'approximate' or 'exact', also on the cp of IvfIndex and HnswIndex. FinalAssignmentMode members are still accepted, and the attribute still reads back as a member until 0.9. - KMeansIterationStats is the one name of the statistics class. FinalAssignmentMode, QGKMeansIterationStats and RaBitQKMeansIterationStats warn when imported or read from the package, through a module-level __getattr__. The extension keeps the 0.8 names; the new ones live in the Python layer, which 0.9 deletes when the extension is renamed. No 0.8 call changes its result, its exception type or its error message. The statistics class now reports its name as KMeansIterationStats.
feat(python): accept the 0.9 k-means names and deprecate the 0.8 spellings
Bump the version to 0.8.5 in pyproject.toml and CMakeLists.txt, and update the install pins, clone commands and version text in the README, home page, installation, quick start and C++ integration pages. Turn docs/docs/releases/0.8.5.md into the release page: drop "(unreleased)" from the title and the navigation, add the Upgrading section, and correct three statements (search options become keyword-only in 0.9, not now; set_centroids used every CPU for every routing type before #231; the stubs cannot mark the deprecations that depend on a value or the two old statistics names). The Python samples need 0.8.5 since #235 and #236, so their README asks for it. README news gains v0.8.5 and keeps the three most recent entries.
chore(release): prepare v0.8.5
main is at v0.8.5 (cf2764f): the 0.9 names with deprecation warnings for the 0.8 spellings (#235, #236) and the 0.8.5 release preparation (#237). Conflicts, resolved by keeping both sides: - docs/docs/index/{hnsw,ivf,qg}.md: the cosine metric and the -1 missing-result ID from dev/0.9, the new names from main. - python_bindings/__init__.py: the FormatError import from dev/0.9 in main's import layout. - python_bindings/__init__.pyi: cosine in the metric lists, routing for initializer. - tests/python/typing/public_api.py: routing= with the cosine metric type. Changes git could not make, because the two sides did not touch the same lines: - The deprecated search overloads from main return int64 IDs, as every search does on dev/0.9; a typing fixture checks it. - The migration guide said three changes come without a warning in 0.9; with int64 IDs, the -1 marker and format 2 that count was wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings
mainat v0.8.5 (cf2764f) intodev/0.9: the 0.9 names with deprecation warnings for the 0.8 spellings (#235, #236) and the 0.8.5 release preparation (#237). It goes through a pull request because pushes todev/0.9run no CI.Merge this with a merge commit, not a squash, so
dev/0.9recordsmainas merged.Conflicts
Six files conflicted. Each resolution keeps both sides.
docs/docs/index/hnsw.md,ivf.md,qg.md: the cosine metric and the-1missing-result ID fromdev/0.9;capacity,routing,ef_searchand their deprecation notes frommain.python_bindings/__init__.py: theFormatErrorimport fromdev/0.9in the import layout ofmain.python_bindings/__init__.pyi:cosinein the metric lists,routingin place ofinitializer.tests/python/typing/public_api.py:routing=together with the cosine metric type.Changes git could not make
The two sides did not touch the same lines here, so there was no conflict to see.
searchoverloads thatmainadded to the stubs returneduint32IDs; ondev/0.9every search returnsint64. They now returnint64, and a new typing fixture checks it (it fails if one overload is changed back).int64, a missing result becomes-1, andsavewrites format 2. The sentence is narrowed and a paragraph points to the 0.9 notes.Checks
On Linux x86-64, Xeon Gold 6418H, GCC 14.3, CPython 3.13.15, against a wheel built from the merged tree:
test_compat_09.py,test_train_api.py,test_symqg_api.pyandtest_examples.pyunder-W error::DeprecationWarning: 183 passed.check-python.sh,mkdocs build --strictandgit diff --checkpass.int64IDs and-1padding, with the cosine metric, and after a format-2 save and load.src,include,tests/unit,tests/consumerandCMakeLists.txt: the project version, 0.8.4 to 0.8.5.Known and left alone
quick_start.mdandinstallation.mdsay they describe 0.8.5 while the branch describes 0.9 behaviour; they said 0.8.4 before. Both change with the 0.9 version bump.reserve_clusterandreservereport the C++ operation namesreserveandresize.docs/docs/index/ivf.mdsaysadd()returns auint32array. That sentence was already ondev/0.9.