-
+
diff --git a/python/voyager/__init__.pyi b/python/voyager/__init__.pyi
index bf9d6153..f40589eb 100644
--- a/python/voyager/__init__.pyi
+++ b/python/voyager/__init__.pyi
@@ -15,7 +15,10 @@ def patch_overload(func):
if func.__doc__:
# Work around the fact that pybind11-stubgen generates
# duplicate docstrings sometimes, once for each overload:
- while func.__doc__[len(func.__doc__) // 2 :].strip() == func.__doc__[: -len(func.__doc__) // 2].strip():
+ while (
+ func.__doc__[len(func.__doc__) // 2 :].strip()
+ == func.__doc__[: -len(func.__doc__) // 2].strip()
+ ):
func.__doc__ = func.__doc__[len(func.__doc__) // 2 :].strip()
return func
@@ -172,7 +175,6 @@ class Index:
1234 in index # => returns True or False
"""
-
def __len__(self) -> int:
"""
Returns the number of non-deleted vectors in this index.
@@ -184,7 +186,6 @@ class Index:
.. note::
This value may differ from :py:attr:`num_elements` if elements have been deleted.
"""
-
@classmethod
def __new__(
cls,
@@ -201,7 +202,6 @@ class Index:
See documentation for :py:meth:`Index.__init__` for details on required arguments.
"""
-
def add_item(
self,
vector: numpy.ndarray[typing.Any, numpy.dtype[numpy.float32]],
@@ -229,7 +229,6 @@ class Index:
If calling :py:meth:`add_item` in a loop, consider batching your
calls by using :py:meth:`add_items` instead, which will be faster.
"""
-
def add_items(
self,
vectors: numpy.ndarray[typing.Any, numpy.dtype[numpy.float32]],
@@ -262,7 +261,6 @@ class Index:
The IDs that were assigned to the provided vectors (either auto-generated or provided), in the
same order as the provided vectors.
"""
-
def as_bytes(self) -> bytes:
"""
Returns the contents of this index as a :py:class:`bytes` object. The resulting object
@@ -280,12 +278,10 @@ class Index:
index: voyager.Index = ...
serialized_index = bytes(index)
"""
-
def get_distance(self, a: typing.List[float], b: typing.List[float]) -> float:
"""
Get the distance between two provided vectors. The vectors must share the dimensionality of the index.
"""
-
def get_vector(self, id: int) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.float32]]:
"""
Get the vector stored in this index at the provided integer ID.
@@ -300,8 +296,9 @@ class Index:
will return a normalized version of the vector that was
originally added to this index.
"""
-
- def get_vectors(self, ids: typing.List[int]) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.float32]]:
+ def get_vectors(
+ self, ids: typing.List[int]
+ ) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.float32]]:
"""
Get one or more vectors stored in this index at the provided integer IDs.
If one or more of the provided IDs cannot be found in the index, a
@@ -312,7 +309,6 @@ class Index:
will return normalized versions of the vector that were
originally added to this index.
"""
-
@staticmethod
@typing.overload
def load(
@@ -405,7 +401,6 @@ class Index:
However, chunks of data of up to 100MB in size will be read from the file-like
object at once, hopefully reducing the impact of the GIL.
"""
-
@staticmethod
@typing.overload
def load(filename: str) -> Index: ...
@@ -452,7 +447,6 @@ class Index:
index: voyager.Index = ...
del index[1234] # deletes the ID 1234
"""
-
def query(
self,
vectors: numpy.ndarray[typing.Any, numpy.dtype[numpy.float32]],
@@ -519,7 +513,6 @@ class Index:
for i, (neighbor_ids, distances) in enumerate(query_neighbor_ids, query_distances):
print(f"\t{i}-th closest neighbor is {neighbor_id}, {distance} away")
"""
-
def resize(self, new_size: int) -> None:
"""
Resize this index, allocating space for up to ``new_size`` elements to
@@ -538,7 +531,6 @@ class Index:
in advance, as subsequent calls to :py:meth:`add_items` will not need
to resize the index on-the-fly.
"""
-
@typing.overload
def save(self, output_path: str) -> None:
"""
@@ -561,7 +553,6 @@ class Index:
one or more chunks of data (of up to 100MB each) to the provided object for writing.
"""
-
@typing.overload
def save(self, file_like: typing.BinaryIO) -> None: ...
def unmark_deleted(self, id: int) -> None:
@@ -571,7 +562,6 @@ class Index:
Once unmarked as deleted, an existing ID will show up in the results of
calls to :py:meth:`query` again.
"""
-
@property
def M(self) -> int:
"""
@@ -582,7 +572,6 @@ class Index:
"""
-
@property
def ef(self) -> int:
"""
@@ -600,7 +589,6 @@ class Index:
"""
-
@ef.setter
def ef(self, arg1: int) -> None:
"""
@@ -616,7 +604,6 @@ class Index:
by passing the ``query_ef`` parameter, allowing finer-grained control over query
speed and recall.
"""
-
@property
def ef_construction(self) -> int:
"""
@@ -626,7 +613,6 @@ class Index:
"""
-
@property
def ids(self) -> LabelSetView:
"""
@@ -648,7 +634,6 @@ class Index:
"""
-
@property
def max_elements(self) -> int:
"""
@@ -669,7 +654,6 @@ class Index:
"""
-
@max_elements.setter
def max_elements(self, arg1: int) -> None:
"""
@@ -688,7 +672,6 @@ class Index:
Note that assigning to this property is functionally identical to
calling :py:meth:`resize`.
"""
-
@property
def num_dimensions(self) -> int:
"""
@@ -696,7 +679,6 @@ class Index:
"""
-
@property
def num_elements(self) -> int:
"""
@@ -707,7 +689,6 @@ class Index:
"""
-
@property
def space(self) -> Space:
"""
@@ -715,7 +696,6 @@ class Index:
"""
-
@property
def storage_data_type(self) -> StorageDataType:
"""
@@ -734,7 +714,6 @@ class E4M3T:
"""
Cast the given E4M3 number to a float.
"""
-
@typing.overload
def __init__(self, value: float) -> None:
"""
@@ -742,7 +721,6 @@ class E4M3T:
Create an E4M3 number given a sign, exponent, and mantissa. If out of range, the values will be clipped.
"""
-
@typing.overload
def __init__(self, sign: int, exponent: int, mantissa: int) -> None: ...
def __repr__(self) -> str: ...
@@ -751,7 +729,6 @@ class E4M3T:
"""
Create an E4M3 number given a raw 8-bit value.
"""
-
@property
def exponent(self) -> int:
"""
@@ -759,7 +736,6 @@ class E4M3T:
"""
-
@property
def mantissa(self) -> int:
"""
@@ -767,7 +743,6 @@ class E4M3T:
"""
-
@property
def raw_exponent(self) -> int:
"""
@@ -775,7 +750,6 @@ class E4M3T:
"""
-
@property
def raw_mantissa(self) -> float:
"""
@@ -783,7 +757,6 @@ class E4M3T:
"""
-
@property
def sign(self) -> int:
"""
@@ -791,7 +764,6 @@ class E4M3T:
"""
-
@property
def size(self) -> int:
"""
@@ -818,7 +790,6 @@ class Float8Index(Index):
"""
Create a new, empty index.
"""
-
def __repr__(self) -> str: ...
pass
@@ -839,7 +810,6 @@ class FloatIndex(Index):
"""
Create a new, empty index.
"""
-
def __repr__(self) -> str: ...
pass
@@ -860,7 +830,6 @@ class E4M3Index(Index):
"""
Create a new, empty index.
"""
-
def __repr__(self) -> str: ...
pass
diff --git a/python/voyager/version.py b/python/voyager/version.py
index f4b30dd7..fa8e6c32 100644
--- a/python/voyager/version.py
+++ b/python/voyager/version.py
@@ -17,6 +17,6 @@
MAJOR = 2
MINOR = 0
-PATCH = 7
+PATCH = 8
__version__ = "%d.%d.%d" % (MAJOR, MINOR, PATCH)