This Python package is a wrapper of the excellent, lightning fast fast3tree
C library,
a BSP tree implementation written by Peter Behroozi.
The C source code fast3tree.c
was (shamlessly) taken from Peter's
Rockstar halo finder.
This project and Peter's fast3tree.c
are both licensed under GPLv3.
You can install from pypi:
pip install fast3tree
Here's a minimal example of how you use it in your python code
import numpy as np
from fast3tree import fast3tree
data = np.random.rand(10000, 3)
with fast3tree(data) as tree:
idx = tree.query_radius([0.5, 0.5, 0.5], 0.2)
# do whatever you like with idx