File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -117,10 +117,10 @@ def __init__(
117117 def __len__ (self ) -> int :
118118 return len (self ._data )
119119
120- def __contains__ (self , key ) -> bool :
120+ def __contains__ (self , key : Any ) -> bool :
121121 return key in self ._data
122122
123- def __getitem__ (self , key ) -> np .ndarray :
123+ def __getitem__ (self , key : Any ) -> np .ndarray :
124124 """Get the point associated with the key."""
125125 return self ._data [key ]
126126
@@ -152,7 +152,8 @@ def insert(
152152 """Add a new point to the index.
153153
154154 Args:
155- key (Any): The key of the new point.
155+ key (Any): The key of the new point. If the key already exists in the
156+ index, the point will be updated and the index will be repaired.
156157 new_point (np.ndarray): The new point to add to the index.
157158 ef (Optional[int]): The number of neighbors to consider during insertion.
158159 level (Optional[int]): The level at which to insert the new point.
You can’t perform that action at this time.
0 commit comments