unum-cloud / usearch

Fast Open-Source Search & Clustering engine × for Vectors & 🔜 Strings × in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram 🔍
https://unum-cloud.github.io/usearch/
Apache License 2.0
2.15k stars 130 forks source link

Bug: Index.vectors returns an error #349

Closed andersonbcdefg closed 7 months ago

andersonbcdefg commented 7 months ago

Describe the bug

When you do index.vectors it provides a (possibly-deprecated?) "vstack" argument that causes an error.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[3], [line 2](vscode-notebook-cell:?execution_count=3&line=2)
      [1](vscode-notebook-cell:?execution_count=3&line=1) index = Index.restore("[/Users/benjamin/Desktop/topic_indexes/topics_bge-micro.usearch](https://file+.vscode-resource.vscode-cdn.net/Users/benjamin/Desktop/topic_indexes/topics_bge-micro.usearch)")
----> [2](vscode-notebook-cell:?execution_count=3&line=2) X_train = index.vectors
      [3](vscode-notebook-cell:?execution_count=3&line=3) X_train.size

File [~/Desktop/repos/taylor/.venv/lib/python3.10/site-packages/usearch/index.py:1135](https://file+.vscode-resource.vscode-cdn.net/Users/benjamin/Desktop/repos/taylor/~/Desktop/repos/taylor/.venv/lib/python3.10/site-packages/usearch/index.py:1135), in Index.vectors(self)
   [1133](https://file+.vscode-resource.vscode-cdn.net/Users/benjamin/Desktop/repos/taylor/~/Desktop/repos/taylor/.venv/lib/python3.10/site-packages/usearch/index.py:1133) @property
   [1134](https://file+.vscode-resource.vscode-cdn.net/Users/benjamin/Desktop/repos/taylor/~/Desktop/repos/taylor/.venv/lib/python3.10/site-packages/usearch/index.py:1134) def vectors(self) -> np.ndarray:
-> [1135](https://file+.vscode-resource.vscode-cdn.net/Users/benjamin/Desktop/repos/taylor/~/Desktop/repos/taylor/.venv/lib/python3.10/site-packages/usearch/index.py:1135)     return self.get(self.keys, vstack=True)

TypeError: Index.get() got an unexpected keyword argument 'vstack'

Steps to reproduce

Create or load an index and then try to use the Index.vectors property

Expected behavior

Getting back the vectors

USearch version

2.8.15

Operating System

Mac OS

Hardware architecture

Arm

Which interface are you using?

Python bindings

Contact Details

andersonbcdefg@gmail.com

Is there an existing issue for this?

Code of Conduct

ashvardanian commented 7 months ago

Nice catch, @andersonbcdefg! Would you be open to submitting a patch for that and maybe test, if it's not yet covered by the suite? Thanks ahead 🤗

andersonbcdefg commented 7 months ago

Sorry, don't have time to do that right now, but figured it would be helpful to point out.

On Mon, Feb 26, 2024 at 5:48 PM Ash Vardanian @.***> wrote:

Nice catch, @andersonbcdefg https://github.com/andersonbcdefg! Would you be open to submitting a patch for that and maybe test, if it's not yet covered by the suite? Thanks ahead 🤗

— Reply to this email directly, view it on GitHub https://github.com/unum-cloud/usearch/issues/349#issuecomment-1965644689, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDJ3R2YMLCRADZUUVJXVA3YVU3PXAVCNFSM6AAAAABDHB7ANSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRVGY2DINRYHE . You are receiving this because you were mentioned.Message ID: @.***>

ashvardanian commented 7 months ago

No problem, I'll patch in a bit 😉

ashvardanian commented 7 months ago

:tada: This issue has been resolved in version 2.9.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: