gudhi-devel icon indicating copy to clipboard operation
gudhi-devel copied to clipboard

[python / knn] n_jobs argument is deprecated for kdtree query with scipy 1.9.0

Open VincentRouvreau opened this issue 2 years ago • 0 comments

According to [https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.cKDTree.query.html#scipy.spatial.cKDTree.query](kdtree query documentation), n_jobs is deprecated starting from scipy>=1.9.0.

With scipy 1.9.0, this leads to an error in test_tomato.py:

gudhi/point_cloud/knn.py:318: in transform
    distances, neighbors = self.kdtree.query(X, k=self.k, **qargs)
_ckdtree.pyx:786: in scipy.spatial._ckdtree.cKDTree.query
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: Unexpected keyword argument {'n_jobs': -1}

The argument should be named workers and the documentation should be checked.

VincentRouvreau avatar Aug 02 '22 08:08 VincentRouvreau