nanoflann python bindings for kdtree with multithreaded queries
Project description
napf - nanoflann wrappers for python and maybe fortran
python
As nanoflann offers template classes, separate classes are implemented in napf
for each {datatype, distance metric}. All the search functions are equipped with multi-thread execution. Uses numpy.ndarray for data input and output.
Currently, the combinations of following options are supported:
data type
: {double, float, int, long} (corresponds to {np.float64, np.float32, np.int32, np.int64})distance metric
: {L1, L2} Note that functions return squared distances, when you use the L2 metric.
quick start
install with pip:
pip install --upgrade pip
pip install napf
Note: in case your system requires a dynamic build, you need a c++11 compatible c++ compiler. To make sure a correct compiler is chosen, set export CC=<your-c-compiler> CXX=<your-c++-compiler>
import napf
import numpy as np
data = <data in 2D array>
queries = <query points in 2D array>
kdt = napf.KDT(tree_data=data, metric=1)
distances, indices = kdt.knn_search(
queries=queries,
kneighbors=3,
nthread=4,
)
...
fortran
If you need fortran bindings, please let us know by creating an issue.
Documentation
This package uses a sphinx
based documentation. An online version of the documentation can be found at napf - documentation.
If you want to build the documentation yourself use the following commands in the package root directory.
pip install -r ./docs/requirements.txt
sphinx-build -W -b html docs/source docs/build
You will find the documentation in the docs/build folder.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for napf-0.1.0-cp312-cp312-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eec876ce603a989595cde695a435f278846b6197bc8a067659670216a0fd410 |
|
MD5 | d8e082d8fb1c265db64c750e57b7fd77 |
|
BLAKE2b-256 | 5a615625d05690db3330661bb5f1fcf093f79cdd9d31633397f4d4fdf5a89bbc |
Hashes for napf-0.1.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7a91fc990f1ceeb7fef58440a692e666b82279374c78a5852a20574876de7a4 |
|
MD5 | 75c5ba1d3b6303c6a403433643c5088a |
|
BLAKE2b-256 | 0fd2072343ac765a8e54c1a11cefeb2c2221ce5a74f25f8f8231df39b7a35e82 |
Hashes for napf-0.1.0-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 233965260ad6b5d9df8eb2652e28166da9d34aa37bb676b1fb1ac27fad19e3c4 |
|
MD5 | 026b611a4b45f029d5280c1ccc2db00b |
|
BLAKE2b-256 | 1b8884c1810ef5c836df6d8494e0d6c6ffeabf86f73f5ba896bbeb86b1d3f24a |
Hashes for napf-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 897266cdeb8151f44001270fa532bb77ac46bb21ddb4f4d345ad519d8b4b1a39 |
|
MD5 | 44aed0548866ffdd3d334f07bf565879 |
|
BLAKE2b-256 | dec0b229d4b4d4c96314366dc1b4a86d9ba8ab3bd36386d5140f6758bdee241c |
Hashes for napf-0.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812653abd4d7572cd859c5805da349a11ef61a960bfe2ea2486f20b2204200cd |
|
MD5 | 4505882915f2a18cfc673c445c60f9bc |
|
BLAKE2b-256 | 0ee37ee7e65510ef46c98459f773010eef2a55e94f5d9cb84f31c10e226db021 |
Hashes for napf-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58c41103aa89a53d2809935b572519a0659c3249067d2bafe020dba6154b0298 |
|
MD5 | 90da41eb0341fb0bf7dbbe2bef2c4bdb |
|
BLAKE2b-256 | 9e9dd7700eb60a9bf0dd8c819d77a12e0c4091aeafe09c5e6ee27a478d950bfb |
Hashes for napf-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e255319a53fe6565cfc856ec122071a7ecf0a9ec69adebbc4614183f6933d5f2 |
|
MD5 | 8adefb8510da7acc7f6935a9e70db3d9 |
|
BLAKE2b-256 | 1ef903a6578ca5fb87fd037ee917ee1436a23db37048bdc53b8a8256c37ee417 |
Hashes for napf-0.1.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76f46b59373973b932c68e8abae2c67d0ee09077d0e785bc850c835e28e38aa7 |
|
MD5 | 3dace5e550152e0cdbfb60fffdbc8c9f |
|
BLAKE2b-256 | 216012dcdb267d40124fe447119fc98b49515892aa95bf05bfe394a622a80934 |
Hashes for napf-0.1.0-cp311-cp311-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d087b5dc5dff57d34df2393b97d85314ca8a249adf117bbaa3d77788829937e |
|
MD5 | 7dc5b921c1ef44632bf4247c96754f5c |
|
BLAKE2b-256 | 7f9b4776f433f72327f63ce268ff8f9d0d564b2a5cf8941ee4b58aa15c6755cc |
Hashes for napf-0.1.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48564614cbf65328887dda3f4f31655150fa2794d2eddaf31c5090cbc9758e99 |
|
MD5 | 2a9c06eb41fe0a15616f658996e4d883 |
|
BLAKE2b-256 | 0ee734e3ffe94607b58adec109b237300d79790f4bcec04160c9ca925b9f9752 |
Hashes for napf-0.1.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 132ef78eacd0a0171f78ff1f3ee6ce7748a2bee27ce6cb91152457e9f2ae07e9 |
|
MD5 | 66c49c566eb2e95a74728fc8d67bc2d4 |
|
BLAKE2b-256 | 0fd069c21181f6e0180b0667fe9cb8bd50313031766b1735b75b454842e92b0d |
Hashes for napf-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c49f07150000a2a07ab5d009b4ac862b174e8fd6262b22ddb67dd9313092d82 |
|
MD5 | 4b0555b248bfa486b7a09cf19cf95dcd |
|
BLAKE2b-256 | 2965d263d29fbf1bcdc69c60e8eb090b141e017447369657493a1637b8387c4f |
Hashes for napf-0.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a58d77dbd73de91f0c18a88194571b5c0bf87862a730e54ba446ca8642082290 |
|
MD5 | 9dd021c404068f274ee7d65875a1cad1 |
|
BLAKE2b-256 | 47cb527221ff628c83b713ac63ca9af46df9163094e90f08f32afdfd0ca9e2d6 |
Hashes for napf-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02a4235aca235b20e952753f00c9625ce8f61b1971d3e2779c9e752414fc55d1 |
|
MD5 | 0ac4f614f424b84deeebcb2ae5e911c4 |
|
BLAKE2b-256 | 71dcde933206020bcace604218ef0172d0215c01077d587684d1dba84289fe20 |
Hashes for napf-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d841950f563ee3d42d96d1ea38acc3c5bc2e2ac065661de6f83b141ef7a7872 |
|
MD5 | 39a1c999fd6bf68605e45bdf4d913e58 |
|
BLAKE2b-256 | 6e3a59b47f4ad7877145680af72831f79e0d3c842f54484f2c896ad0cce93947 |
Hashes for napf-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 205280cf73f23e85b7c8da7c4a6d114c7b6206cd8e1e7e827e434c2b8bae70b5 |
|
MD5 | 3859adad926f166c303a31ce303f29f0 |
|
BLAKE2b-256 | ee191ba40fa9a354ba23a49ec36841ebfd4d98aca078ac6c7820dc308feeed57 |
Hashes for napf-0.1.0-cp310-cp310-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91043e51db9481d79d71e34d5c8b7b799490241f423301e9672eae1710f728af |
|
MD5 | 41be1d0c00161d264e8f01af646f9338 |
|
BLAKE2b-256 | a940308376430a14fe800d623a1a3ae9533864d64823c9b2d22675b6e95abed2 |
Hashes for napf-0.1.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3885026973b8f2b4bcbeb2e538a2814a82bb3bfb868c98d70b27e6c810fd399 |
|
MD5 | 6aaa00b22871867d6317b62939bb6dc8 |
|
BLAKE2b-256 | ff5e6f3f2947eb5521c0819b234cede285ed404e09565ff5f49f9e70c9cc4924 |
Hashes for napf-0.1.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f1b7a4aae677a3af352c7aed06037316c32493781ff30eda3693ec8d878037a |
|
MD5 | 24ede166184b173f8fbec63c46c471b8 |
|
BLAKE2b-256 | 048d3412526bd86f5cbbf89104992520ddf9069c3dd60663cdf7c797e6eec8f5 |
Hashes for napf-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77ed08cd2aa5a7cef585973251f864dac57101a1f6181003f976c03d67055a18 |
|
MD5 | 2673cdd3c534ccf669618bdb98315486 |
|
BLAKE2b-256 | e419d419c7630ec6a0974be1249e72cf7f7a5ffdfeea22920af824ceaefa8791 |
Hashes for napf-0.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b20354fa293f958c09b96fd8909d2ba3572983b2a83fd7b7eaec369263a0ca1 |
|
MD5 | 78ae3d1c770ccd4defc016b15b4b16ab |
|
BLAKE2b-256 | 65bc892e5275ac0d0351e7b76d096a17f85ecb75c54d0ca87f6287833aa131bf |
Hashes for napf-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13f7c7028785beea0c9b85853db0f7a3ded8332544bf8de5cf2f832e535b0995 |
|
MD5 | fcd625a9a902fcce5ce7a1b220741977 |
|
BLAKE2b-256 | 5b98baa93685736f0c32ac3bcc92fe6cc85cdf4789995e12c94432d50b89b4e5 |
Hashes for napf-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b27d6d289dc93b82e42a3df91dab0f4f61dca0fc4ee3ab1b43ab320eff9fb0f |
|
MD5 | a52205b01c7bffe08f624c0414c2d359 |
|
BLAKE2b-256 | 6cee942cf0b4f72cea67bea984f76f11ddf9ee2c2d9d85db51c5673357144ca9 |
Hashes for napf-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19221823308abae26447673538d05eb9da0fb63d4bff3641a31fed37523b4f43 |
|
MD5 | 32072a4cc3ea5b06eb9bce426c3bbff5 |
|
BLAKE2b-256 | 32a25f9e94908a0d0a80457a2ff2e5d0366f86b30681cb9a60e685331876e529 |
Hashes for napf-0.1.0-cp39-cp39-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dbc5dd40b22a788fe1d61f4721aabe120152ce11f6ec4902954dbfeec789f7f |
|
MD5 | a830804cbebac282533f738f82b23b96 |
|
BLAKE2b-256 | 6d33d2f8d108d82c91da7c4fff1a48879c81058f8fb8fa885399108d009f87fb |
Hashes for napf-0.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2bfd1e8f3da18886a881696fdbe6ba583309918471e3548ad5be697f75764bb |
|
MD5 | 80a17b18577245d1372dabe815e2846c |
|
BLAKE2b-256 | aac241099395761bf52cb9e3fe3a45ad6dea3b7f8db0340eb08b6d5050096ec8 |
Hashes for napf-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b84d230bf77ae90515ca9db8c05a5d94fd06b07448bc7abd12ecee092213b1c |
|
MD5 | 244f79f8b0154d775adb9ed3375ab43d |
|
BLAKE2b-256 | be59ecb40ddff8b2e376d16a0a441ccb69a388c030f177e730bb35a0230c92c6 |
Hashes for napf-0.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b4cb122504ab13bd640dc6cb31ac79fbd418a0bb431726cbfddb5048472a6da |
|
MD5 | f07fe7ec191b402db0659cbd28e624fb |
|
BLAKE2b-256 | 352cb98f7099caa3197b921df621e4897f6a9875d3e4799deeb76d2a3aa55efc |
Hashes for napf-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6960c18211963a6fafa7f3cb379ffe5edc1e79edf756ede325049cc55f4e19c0 |
|
MD5 | d36c7092c19a90d6c11d90c7c59c0eab |
|
BLAKE2b-256 | 6f23d882620acf410e9faf694614f4c8afe9257aa1f365e8d978de0060ea5168 |
Hashes for napf-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16bd3c92fe6b6002f41941f0ff634482c437b095944687403a6f0738a4a639e1 |
|
MD5 | bf57a06ac2c037de46d619f1321ff48c |
|
BLAKE2b-256 | ae990aaa00205dc23959a9d47edb919e8a68c5570efe60116dc86e24e1a45e59 |
Hashes for napf-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a427e3a2b50d0794395103d727e67ffd6d374e7e5f93cc7bdf2d99cba538f5f |
|
MD5 | bb3f771b01b3dbf8fa445ed3a08c5335 |
|
BLAKE2b-256 | dd81ae0f003bb85b045aeb2fc00ccf30719f6c7731f6582fc15d334ef2cb45a7 |
Hashes for napf-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 179705997b7b677e668ae7c60943a214bb383537b2075d7c557a043e1cf8955e |
|
MD5 | b9730e37171579c2796346c131633cca |
|
BLAKE2b-256 | 1d2c93aa250478da7cbfc9fc73fcf311900be33220f721275296cea6059e7a4e |
Hashes for napf-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17c3cfac34cfd8be3bba13d8e38610bc0942d2eb081c144ce91b5eab2abcd80a |
|
MD5 | 9d7473443e7a05d76b252f83d485fe12 |
|
BLAKE2b-256 | f8d4c27f42c448f0802c1cf69bf4b429b3887319f7bf59f372ad240c131cf768 |
Hashes for napf-0.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a7aa4033fb81e424ab2dc366998a878742b87d4dc7cc7e933c3297152cce57a |
|
MD5 | cfb8765af935527d61bb5ee161509a30 |
|
BLAKE2b-256 | 3806f448002673fc7d13322df36abd2897ebc162f4e69c7289891319a6d61071 |
Hashes for napf-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 142b41534e92749539565f8b89628b2b97bb5b7ef4289fd3aee8aff01ee6b1c8 |
|
MD5 | aa10ded45646f961738a7c8258afa2f6 |
|
BLAKE2b-256 | 7d62c3e3a4d90d781ae3ca67c7296aa63d017e0e3ccffc9948040f07ccd58919 |
Hashes for napf-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed45455e42553c5bf61c6e8e44011190812353efdf1827646096cf8f3593cd81 |
|
MD5 | bc71c7ee16ebffb806a197424b948a5b |
|
BLAKE2b-256 | 474f1aa82a01635d6077d3f9c2dec5ebba1793b243a44e5960bfd6a8b518475f |
Hashes for napf-0.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 711deacd8ee31bf2fb6d6175125371232bad3b601d4407e99aa2fe739f646840 |
|
MD5 | 27d624cacd00c7e7839a7c55e5622bc0 |
|
BLAKE2b-256 | e4b9917a50c5362a02a9e233e25b42a0339073350613bcc6248acf76506cd4b2 |
Hashes for napf-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e993d7e360834afdff094ddd113ca96c20d87dbda43d8ab41af012ed908c64f |
|
MD5 | f058cd77dac6034e8f7be3b871af0d87 |
|
BLAKE2b-256 | cff92cfac365d70a0361f71227dd9c915945126af46f1d2874148a1bc33e1f74 |
Hashes for napf-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d07f2e3aa63624986c6b6fa4ebe358217cd8487a017cab35f4c4ff5f6e67430 |
|
MD5 | 9ada0738014d78e6471d5b397f760831 |
|
BLAKE2b-256 | 9972f57507d1f728072b79ee989cec42a41bfd1a2d2ee1baa69a3aee943f51dd |
Hashes for napf-0.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06be9df0fe0787611569720abe4dce7c537f98e0932f71b833f7e22936bdf4c0 |
|
MD5 | 621dbcbe4f83ac359c04ee093944962e |
|
BLAKE2b-256 | ba74259b43fe02ea77490ce48a78f50f83f5b727a56e2e457cfdcc2a3f838401 |
Hashes for napf-0.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 320a7fc5c8ac58e8d9d614054366254e5cafc73078003250d093a39954a734bc |
|
MD5 | 161650466bc7c79fcad0907936716b31 |
|
BLAKE2b-256 | bdf4ec6d58696cf213f561e2e81582fe3781da83dcc324112869c8881a0d35a4 |
Hashes for napf-0.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e53975408b36c19ed96a003cab873196ad4205363b90fda6d224eaaf7757feb6 |
|
MD5 | ce2ebb9b049b2d533ddeb9ac659cfe56 |
|
BLAKE2b-256 | 1f17cca38bbcac6b6f2801bed4b2471d40d4528366b9a39312bd352f947c8366 |