minor: fix python doc string for ivf index params (#473)

This commit is contained in:
Qinren Zhou
2026-06-09 11:41:03 +08:00
committed by GitHub
parent d96de9289e
commit e8b888f26b
4 changed files with 13 additions and 14 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ class TestIVFIndexParam:
def test_default(self):
param = IVFIndexParam()
assert param.metric_type == MetricType.IP
assert param.n_list == 0
assert param.n_list == 10
assert param.quantize_type == QuantizeType.UNDEFINED
assert param.type == IndexType.IVF
+5 -6
View File
@@ -443,8 +443,7 @@ class IVFIndexParam(VectorIndexParam):
metric_type (MetricType): Distance metric used for similarity computation.
Default is ``MetricType.IP`` (inner product).
n_list (int): Number of clusters (inverted lists) to partition the dataset into.
If set to 0, the system will auto-select a reasonable value based on data size.
Default is 0 (auto).
Default is 10.
n_iters (int): Number of iterations for k-means clustering during index training.
Higher values yield more stable centroids. Default is 10.
use_soar (bool): Whether to enable SOAR (Scalable Optimized Adaptive Routing)
@@ -469,7 +468,7 @@ class IVFIndexParam(VectorIndexParam):
def __init__(
self,
metric_type: _zvec.typing.MetricType = ...,
n_list: typing.SupportsInt = 0,
n_list: typing.SupportsInt = 10,
n_iters: typing.SupportsInt = 10,
use_soar: bool = False,
quantize_type: _zvec.typing.QuantizeType = ...,
@@ -479,8 +478,8 @@ class IVFIndexParam(VectorIndexParam):
Args:
metric_type (MetricType, optional): Distance metric. Defaults to MetricType.IP.
n_list (int, optional): Number of inverted lists (clusters). Set to 0 for auto.
Defaults to 0.
n_list (int, optional): Number of inverted lists (clusters).
Defaults to 10.
n_iters (int, optional): Number of k-means iterations during training.
Defaults to 10.
use_soar (bool, optional): Enable SOAR optimization. Defaults to False.
@@ -504,7 +503,7 @@ class IVFIndexParam(VectorIndexParam):
@property
def n_list(self) -> int:
"""
int: Number of inverted lists (0 = auto).
int: Number of inverted lists.
"""
@property
@@ -794,8 +794,7 @@ Attributes:
metric_type (MetricType): Distance metric used for similarity computation.
Default is ``MetricType.IP`` (inner product).
n_list (int): Number of clusters (inverted lists) to partition the dataset into.
If set to 0, the system will auto-select a reasonable value based on data size.
Default is 0 (auto).
Default is 10.
n_iters (int): Number of iterations for k-means clustering during index training.
Higher values yield more stable centroids. Default is 10.
use_soar (bool): Whether to enable SOAR (Scalable Optimized Adaptive Routing)
@@ -817,7 +816,7 @@ Examples:
)pbdoc");
ivf_params
.def(py::init<MetricType, int, int, bool, QuantizeType>(),
py::arg("metric_type") = MetricType::IP, py::arg("n_list") = 0,
py::arg("metric_type") = MetricType::IP, py::arg("n_list") = 10,
py::arg("n_iters") = 10, py::arg("use_soar") = false,
py::arg("quantize_type") = QuantizeType::UNDEFINED,
R"pbdoc(
@@ -825,8 +824,8 @@ Constructs an IVFIndexParam instance.
Args:
metric_type (MetricType, optional): Distance metric. Defaults to MetricType.IP.
n_list (int, optional): Number of inverted lists (clusters). Set to 0 for auto.
Defaults to 0.
n_list (int, optional): Number of inverted lists (clusters).
Defaults to 10.
n_iters (int, optional): Number of k-means iterations during training.
Defaults to 10.
use_soar (bool, optional): Enable SOAR optimization. Defaults to False.
@@ -834,7 +833,7 @@ Args:
Defaults to QuantizeType.UNDEFINED.
)pbdoc")
.def_property_readonly("n_list", &IVFIndexParams::n_list,
"int: Number of inverted lists (0 = auto).")
"int: Number of inverted lists.")
.def_property_readonly(
"n_iters", &IVFIndexParams::n_iters,
"int: Number of k-means iterations during training.")
+2 -1
View File
@@ -3,7 +3,8 @@ include(${PROJECT_ROOT_DIR}/cmake/option.cmake)
# Crash recovery tests rely on fork()+execvp()+kill() to spawn helper processes
# and simulate crashes. These POSIX process APIs are prohibited on iOS.
if(IOS)
# On Windows the tests also fail consistently, so skip them there as well.
if(IOS OR WIN32)
return()
endif()