Python-KD-Tree icon indicating copy to clipboard operation
Python-KD-Tree copied to clipboard

fix when points are np.ndarray (without numpy dependency

Open Bjotori opened this issue 2 years ago • 1 comments

fix sort with np.ndarray fix warning 'np.bool_' scalars to be interpreted as an index

Bjotori avatar Dec 12 '22 08:12 Bjotori

I don't think this solution works as the ndarray sorting is still glitchy

File ~/kd_tree.py:48, in KDTree.__init__.<locals>.make(points, i)
     46     i = (i + 1) % dim
     47     m = len(points) >> 1
...
---> 45     points.sort(axis=i) # np.ndarray
     46 i = (i + 1) % dim
     47 m = len(points) >> 1

AxisError: axis 2 is out of bounds for array of dimension 2

gitkeniwo avatar Mar 07 '23 14:03 gitkeniwo