Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Python wrapper #3

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open

Conversation

grihabor
Copy link
Contributor

@grihabor grihabor commented Sep 18, 2018

Hi! I need some feedback on my python wrapper for your library.

Build and Install

Package uses setuptools extension interface, so it can be properly built and installed into virtualenv.
You need g++, make, cmake and swig to be installed on your system.

> python setup.py install

Try it out

from ivfhnsw import Index, IndexGrouping
import numpy as np

index = Index(4, 4, 4, 4)
index.build_quantizer('', '', '')
x = np.array([[5, 5, 5, 5]], dtype=np.float32)
labels = index.assign(x, 1)
distances, labels_ = index.search([[1, 2, 3, 4]], 1)
print(labels, distances, labels_)

This example is from python-tests/ directory

Plans

I need to know if anyone really needs a fully working python interface.
Any help is appreciated!

@dbaranchuk
Copy link
Owner

Hi,

Thanks for your contribution! I'll test your wrapper on real data at an early date. If everything is fine, I'll accept your request.

@grihabor
Copy link
Contributor Author

I think, it's a good idea to split the pull request into 2 parts:

  • code structure refactoring (now you can use cmake out-of-source)
  • python wrapper

In addition to the python interface, please also check the library build

@grihabor grihabor force-pushed the python-wrapper branch 3 times, most recently from 79eb50f to 30e128f Compare September 18, 2018 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants