|
4 | 4 |
|
5 | 5 | from numba.core import types, cgutils
|
6 | 6 | from numba.experimental import structref
|
7 |
| -from numba.extending import overload_method, intrinsic |
| 7 | +from numba.extending import overload_method, intrinsic, overload_attribute |
8 | 8 | from .ckdtree import ckdtree as ckdtree_ct
|
9 | 9 | import warnings
|
10 | 10 | from typing import Optional, Any
|
@@ -65,7 +65,7 @@ def _np_min(array, axis):
|
65 | 65 |
|
66 | 66 | @nb.njit(nogil=True, fastmath=True, cache=True, inline='always')
|
67 | 67 | def _np_max(array, axis):
|
68 |
| - return _np_apply_along_axis(np.amin, axis, array) |
| 68 | + return _np_apply_along_axis(np.amax, axis, array) |
69 | 69 |
|
70 | 70 |
|
71 | 71 | def _convert_to_valid_input(X, n_features, dtype):
|
@@ -251,12 +251,12 @@ def _KDTree_get_idx(self):
|
251 | 251 |
|
252 | 252 | @nb.njit(cache=True)
|
253 | 253 | def _KDTree_get_size(self):
|
254 |
| - return self._size() |
| 254 | + return self.size |
255 | 255 |
|
256 | 256 |
|
257 | 257 | @nb.njit(cache=True)
|
258 | 258 | def _KDTree_get_leafsize(self):
|
259 |
| - return self._leafsize() |
| 259 | + return self.leafsize |
260 | 260 |
|
261 | 261 |
|
262 | 262 | @nb.njit(cache=True)
|
@@ -285,21 +285,21 @@ def _KDTree_query_radius_parallel(self, X, r, p=2.0, eps=0.0, return_sorted=Fals
|
285 | 285 |
|
286 | 286 |
|
287 | 287 | # functions required for pickling the Kdtree
|
288 |
| -@overload_method(KDTreeNumbaType, "_size", jit_options={"cache": True}) |
| 288 | +@overload_attribute(KDTreeNumbaType, "size", jit_options={"cache": True}) |
289 | 289 | def _ol_size(self):
|
290 | 290 | dtype = self.field_dict['data'].dtype
|
291 | 291 | if dtype != nb.types.float32:
|
292 | 292 | dtype = nb.types.float64
|
293 | 293 |
|
294 | 294 | func_size = ckdtree_ct.size[dtype]
|
295 | 295 |
|
296 |
| - def _size_impl(self): |
| 296 | + def size_impl(self): |
297 | 297 | return func_size(self.ckdtree)
|
298 | 298 |
|
299 |
| - return _size_impl |
| 299 | + return size_impl |
300 | 300 |
|
301 | 301 |
|
302 |
| -@overload_method(KDTreeNumbaType, "_leafsize", jit_options={"cache": True}) |
| 302 | +@overload_attribute(KDTreeNumbaType, "_leafsize", jit_options={"cache": True}) |
303 | 303 | def _ol_leafsize(self):
|
304 | 304 | """Returns the leaf size of the underlying tree
|
305 | 305 | """
|
|
0 commit comments