Skip to content

Commit

Permalink
Improve: Reporting connectivity in repr
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Aug 24, 2023
1 parent c99d528 commit 58b043c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/usearch/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,11 +1095,12 @@ def specs(self) -> Dict[str, Union[str, int, bool]]:
}

def __repr__(self) -> str:
f = "usearch.Index({} x {}, {}, expansion: {} & {}, {} vectors in {} levels)"
f = "usearch.Index({} x {}, {}, connectivity: {}, expansion: {} & {}, {} vectors in {} levels)"
return f.format(
self.dtype,
self.ndim,
self.metric,
self.connectivity,
self.expansion_add,
self.expansion_search,
len(self),
Expand All @@ -1117,6 +1118,7 @@ def _repr_pretty_(self, printer, cycle) -> str:
f"-- data type: {self.dtype}",
f"-- dimensions: {self.ndim}",
f"-- metric: {self.metric}",
f"-- connectivity: {self.connectivity}",
f"-- expansion on addition:{self.expansion_add} candidates",
f"-- expansion on search: {self.expansion_search} candidates",
"- binary",
Expand Down

0 comments on commit 58b043c

Please sign in to comment.