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

How to use Numba for a spatial.cKDTree script ? #36

Open
HerveGlz opened this issue Feb 8, 2020 · 7 comments
Open

How to use Numba for a spatial.cKDTree script ? #36

HerveGlz opened this issue Feb 8, 2020 · 7 comments
Labels
feature_request Request for a feature

Comments

@HerveGlz
Copy link

HerveGlz commented Feb 8, 2020

Hi all,

I am searching for a way to use Numba so that I can improve a KDTree processing script with scipy.
But it seems that it doesn't work when I apply the procedure from numba-scipy. I wonder if the spatial.cKDTree / spatial.KDTree is implemented within numba-scipy... Is it ?

Is there someone who could give me a hand on it ?
Or have I to compile my script with Cython ?

Thanks in advance,
Warm regards,
Hervé

@stuartarchibald
Copy link
Contributor

Thanks for the request. numba-scipy only supports a few things at present, scipy.spatial isn't one of those, if you do write support please consider contributing it to this project. Thanks!

@stuartarchibald stuartarchibald added the feature_request Request for a feature label Feb 10, 2020
@jackd
Copy link

jackd commented Feb 14, 2020

@HerveGlz this isn't really related to numba-scipy, but a little while ago I ported part of scikit-learn's KDTree implementation - you can find it here. It's a bit messy, but depending on what usage you want and how keen you are to look through the examples/benchmark scripts it may be enough to cover what you want.

@HerveGlz
Copy link
Author

@jackd Thanks for your message. If I may, your link seems to be dead... Will it be possible to update it ?

@jackd
Copy link

jackd commented Feb 16, 2020

@HerveGlz my bad, had it private. Let me know if you still can't see it.

@HerveGlz
Copy link
Author

@jackd Thanks a lot Jack ! The link works perfectly. I will try to implement your solution in my script and will get back to you.

@sgbaird
Copy link

sgbaird commented Sep 7, 2021

Another resource to look at: https://github.com/lmcinnes/pynndescent
UMAP uses this under the hood if I remember correctly, and many metrics (including custom) are supported and fast.

@promitmoitra
Copy link

https://github.com/mortacious/numba-kdtree
The generation of the tree has to be done outside a numba compiled function, but the generated tree can be passed to, and parsed within, a numba compiled function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request Request for a feature
Projects
None yet
Development

No branches or pull requests

5 participants