mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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.
This commit is contained in:
parent
ff3c55bb98
commit
96c51a9dbf
4 changed files with 320 additions and 3 deletions
32
gnu/packages/patches/python-scikit-optimize-1148.patch
Normal file
32
gnu/packages/patches/python-scikit-optimize-1148.patch
Normal file
|
@ -0,0 +1,32 @@
|
|||
From 3a5d5eb90ec9d8d4905c05387748486157cadbbb Mon Sep 17 00:00:00 2001
|
||||
From: valtron <valtron2000@gmail.com>
|
||||
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
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue