aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-scikit-optimize-1148.patch
blob: 6ad854ab1e4e915de5f2781d10a327baf5076960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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