diff options
author | Ricardo Wurmus <[email protected]> | 2023-05-10 14:54:22 +0200 |
---|---|---|
committer | Ricardo Wurmus <[email protected]> | 2023-05-10 19:27:07 +0200 |
commit | 96c51a9dbfda0a08a2f2cdbd1f62e1c064d22437 (patch) | |
tree | 8160aa502045072025c7cb80c67b24a62e344bcb /gnu/packages/patches/python-scikit-optimize-1148.patch | |
parent | ff3c55bb98c1b9629061af8f8d3848bc6faea064 (diff) |
gnu: python-scikit-optimize: Fix build with newer numpy and sklearn.
* gnu/packages/patches/python-scikit-optimize-1148.patch,
gnu/packages/patches/python-scikit-optimize-1150.patch: New patches.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/python-science.scm (python-scikit-optimize)[source]: Fetch with
git and apply patches.
Diffstat (limited to 'gnu/packages/patches/python-scikit-optimize-1148.patch')
-rw-r--r-- | gnu/packages/patches/python-scikit-optimize-1148.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-scikit-optimize-1148.patch b/gnu/packages/patches/python-scikit-optimize-1148.patch new file mode 100644 index 0000000000..6ad854ab1e --- /dev/null +++ b/gnu/packages/patches/python-scikit-optimize-1148.patch @@ -0,0 +1,32 @@ +From 3a5d5eb90ec9d8d4905c05387748486157cadbbb Mon Sep 17 00:00:00 2001 +From: valtron <[email protected]> +Date: Tue, 14 Feb 2023 09:56:10 -0700 +Subject: [PATCH] `np.int` -> `int` + +`np.int is int` and it was deprecated in numpy 1.20: https://numpy.org/doc/1.20/release/1.20.0-notes.html#deprecations +--- + skopt/space/transformers.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/skopt/space/transformers.py b/skopt/space/transformers.py +index 68892952..f2dfb164 100644 +--- a/skopt/space/transformers.py ++++ b/skopt/space/transformers.py +@@ -259,7 +259,7 @@ def transform(self, X): + if (self.high - self.low) == 0.: + return X * 0. + if self.is_int: +- return (np.round(X).astype(np.int) - self.low) /\ ++ return (np.round(X).astype(int) - self.low) /\ + (self.high - self.low) + else: + return (X - self.low) / (self.high - self.low) +@@ -272,7 +272,7 @@ def inverse_transform(self, X): + raise ValueError("All values should be greater than 0.0") + X_orig = X * (self.high - self.low) + self.low + if self.is_int: +- return np.round(X_orig).astype(np.int) ++ return np.round(X_orig).astype(int) + return X_orig + + |