summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2021-12-23 16:36:02 +0100
committerGard Spreemann <gspr@nonempty.org>2021-12-23 16:40:08 +0100
commit8f57ff2d7463a8d46b6e1a8eb6946fe90b42ba74 (patch)
tree504599902c14ea52b9caf8538558a6ca9c73ba1d /debian/patches
parentb9553edb64ed86f20af06ed37f826fb4c2a11b55 (diff)
Add patch to turn Scikit-Learn positional args into keyword ones
For compatibility with the 1.0 series of Scikit-Learn.
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0007-Turn-positional-argument-into-keyword-argument.patch23
-rw-r--r--debian/patches/series1
2 files changed, 24 insertions, 0 deletions
diff --git a/debian/patches/0007-Turn-positional-argument-into-keyword-argument.patch b/debian/patches/0007-Turn-positional-argument-into-keyword-argument.patch
new file mode 100644
index 00000000..109e18ee
--- /dev/null
+++ b/debian/patches/0007-Turn-positional-argument-into-keyword-argument.patch
@@ -0,0 +1,23 @@
+From: Gard Spreemann <gspr@nonempty.org>
+Date: Thu, 23 Dec 2021 16:33:25 +0100
+Subject: Turn positional argument into keyword argument
+
+After the 0.24.x series, Scikit-Learn got rid of all of most of its
+positional arguments in favor of keyword ones.
+---
+ src/python/gudhi/point_cloud/knn.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/python/gudhi/point_cloud/knn.py b/src/python/gudhi/point_cloud/knn.py
+index 994be3b..829bf1b 100644
+--- a/src/python/gudhi/point_cloud/knn.py
++++ b/src/python/gudhi/point_cloud/knn.py
+@@ -111,7 +111,7 @@ class KNearestNeighbors:
+ nargs = {
+ k: v for k, v in self.params.items() if k in {"p", "n_jobs", "metric_params", "algorithm", "leaf_size"}
+ }
+- self.nn = NearestNeighbors(self.k, metric=self.metric, **nargs)
++ self.nn = NearestNeighbors(n_neighbors=self.k, metric=self.metric, **nargs)
+ self.nn.fit(X)
+
+ if self.params["implementation"] == "hnsw":
diff --git a/debian/patches/series b/debian/patches/series
index 8479e6fb..5b7f187e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
0005-Disable-Sphinx.patch
0006-Install-Python-module-in-correct-location.patch
0007-Move-towards-reproducible-builds.patch
+0007-Turn-positional-argument-into-keyword-argument.patch