summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com>2022-11-04 17:30:18 +0100
committerGitHub <noreply@github.com>2022-11-04 17:30:18 +0100
commitaa2dd7a0498594229fd828079bc069d71bbba59a (patch)
treef458ceace90356362458b0c25cdc49eb538ebbce
parent7595644442365412cf7afce56eafea85342da07f (diff)
parent95330fb658db4184813d8720c52da5e25bcdd38c (diff)
Merge pull request #717 from mglisse/scipy19
Translate n_jobs to workers for SciPy
-rw-r--r--src/python/doc/installation.rst2
-rw-r--r--src/python/gudhi/point_cloud/knn.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst
index b704f778..276ac4e2 100644
--- a/src/python/doc/installation.rst
+++ b/src/python/doc/installation.rst
@@ -391,7 +391,7 @@ The :doc:`persistence graphical tools </persistence_graphical_tools_user>` and
mathematics, science, and engineering.
:class:`~gudhi.point_cloud.knn.KNearestNeighbors` can use the Python package
-`SciPy <http://scipy.org>`_ as a backend if explicitly requested.
+`SciPy <http://scipy.org>`_ :math:`\geq` 1.6.0 as a backend if explicitly requested.
TensorFlow
----------
diff --git a/src/python/gudhi/point_cloud/knn.py b/src/python/gudhi/point_cloud/knn.py
index de5844f9..7dc83817 100644
--- a/src/python/gudhi/point_cloud/knn.py
+++ b/src/python/gudhi/point_cloud/knn.py
@@ -314,7 +314,9 @@ class KNearestNeighbors:
return None
if self.params["implementation"] == "ckdtree":
- qargs = {key: val for key, val in self.params.items() if key in {"p", "eps", "n_jobs"}}
+ qargs = {key: val for key, val in self.params.items() if key in {"p", "eps"}}
+ # SciPy renamed n_jobs to workers
+ qargs["workers"] = self.params.get("workers") or self.params.get("n_jobs") or 1
distances, neighbors = self.kdtree.query(X, k=self.k, **qargs)
if k == 1:
# SciPy decided to squeeze the last dimension for k=1