Skip to content

Commit

Permalink
Remove unused index and metric_type check (#1636)
Browse files Browse the repository at this point in the history
Signed-off-by: chasingegg <[email protected]>
  • Loading branch information
chasingegg authored Aug 8, 2023
1 parent 7222d55 commit 550ab25
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions pymilvus/client/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,35 +202,6 @@ def is_legal_replica_number(replica_number: int) -> bool:
return isinstance(replica_number, int)


# https://milvus.io/cn/docs/v1.0.0/metric.md#floating
def is_legal_index_metric_type(index_type: str, metric_type: str) -> bool:
if index_type not in (
"GPU_IVF_FLAT",
"GPU_IVF_PQ",
"FLAT",
"IVF_FLAT",
"IVF_SQ8",
"IVF_PQ",
"HNSW",
"AUTOINDEX",
"DISKANN",
):
return False
if metric_type not in ("L2", "IP", "COSINE"):
return False
return True


# https://milvus.io/cn/docs/v1.0.0/metric.md#binary
def is_legal_binary_index_metric_type(index_type: str, metric_type: str) -> bool:
if index_type == "BIN_FLAT":
if metric_type in ("JACCARD", "TANIMOTO", "HAMMING", "SUBSTRUCTURE", "SUPERSTRUCTURE"):
return True
elif index_type == "BIN_IVF_FLAT" and metric_type in ("JACCARD", "TANIMOTO", "HAMMING"):
return True
return False


def _raise_param_error(param_name: str, param_value: Any) -> None:
raise ParamError(message=f"`{param_name}` value {param_value} is illegal")

Expand Down

0 comments on commit 550ab25

Please sign in to comment.