me
/
guix
Archived
1
0
Fork 0
This repository has been archived on 2024-08-07. You can view files and clone it, but cannot push or open issues/pull-requests.
guix/gnu/packages/patches/python-scikit-optimize-1148...

33 lines
1.2 KiB
Diff

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