From 09de72aad036c5b9fb1cca78642cbe04531ea9d8 Mon Sep 17 00:00:00 2001
From: Philip Wilk
Date: Sun, 23 Mar 2025 16:43:59 +0000
Subject: [PATCH] python3Packages.mlxtend: 0.23.3->0.23.4
---
...test-replace-np.float_-to-np.float64.patch | 109 ------------------
.../python-modules/mlxtend/default.nix | 9 +-
2 files changed, 2 insertions(+), 116 deletions(-)
delete mode 100644 pkgs/development/python-modules/mlxtend/0001-fix-test-replace-np.float_-to-np.float64.patch
diff --git a/pkgs/development/python-modules/mlxtend/0001-fix-test-replace-np.float_-to-np.float64.patch b/pkgs/development/python-modules/mlxtend/0001-fix-test-replace-np.float_-to-np.float64.patch
deleted file mode 100644
index c196d2bb5035..000000000000
--- a/pkgs/development/python-modules/mlxtend/0001-fix-test-replace-np.float_-to-np.float64.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From 360cb75317aecaf6b9abcf24f0577afef75c464e Mon Sep 17 00:00:00 2001
-From: wxt <3264117476@qq.com>
-Date: Mon, 6 Jan 2025 20:41:27 +0800
-Subject: [PATCH] fix(test): replace np.float_ to np.float64
-
----
- mlxtend/_base/_regressor.py | 2 +-
- mlxtend/_base/tests/test_classifier.py | 2 +-
- mlxtend/_base/tests/test_cluster.py | 2 +-
- mlxtend/classifier/multilayerperceptron.py | 2 +-
- mlxtend/classifier/softmax_regression.py | 2 +-
- mlxtend/math/linalg.py | 2 +-
- mlxtend/plotting/tests/test_decision_regions.py | 2 +-
- 7 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/mlxtend/_base/_regressor.py b/mlxtend/_base/_regressor.py
-index e3d0a1d..1d3a5d6 100644
---- a/mlxtend/_base/_regressor.py
-+++ b/mlxtend/_base/_regressor.py
-@@ -16,7 +16,7 @@ class _Regressor(object):
- pass
-
- def _check_target_array(self, y, allowed=None):
-- if not isinstance(y[0], (float, np.float_)):
-+ if not isinstance(y[0], (float, np.float64)):
- raise AttributeError("y must be a float array.\nFound %s" % y.dtype)
-
- def fit(self, X, y, init_params=True):
-diff --git a/mlxtend/_base/tests/test_classifier.py b/mlxtend/_base/tests/test_classifier.py
-index f77f74d..1bbac6d 100644
---- a/mlxtend/_base/tests/test_classifier.py
-+++ b/mlxtend/_base/tests/test_classifier.py
-@@ -51,7 +51,7 @@ def test_check_labels_not_ok_1():
-
-
- def test_check_labels_integer_notok():
-- y = np.array([1.0, 2.0], dtype=np.float_)
-+ y = np.array([1.0, 2.0], dtype=np.float64)
- cl = BlankClassifier(print_progress=0, random_seed=1)
- with pytest.raises(AttributeError) as excinfo:
- cl._check_target_array(y)
-diff --git a/mlxtend/_base/tests/test_cluster.py b/mlxtend/_base/tests/test_cluster.py
-index 6da1a9d..54c2526 100644
---- a/mlxtend/_base/tests/test_cluster.py
-+++ b/mlxtend/_base/tests/test_cluster.py
-@@ -51,7 +51,7 @@ def test_check_labels_not_ok_1():
-
-
- def test_check_labels_integer_notok():
-- y = np.array([1.0, 2.0], dtype=np.float_)
-+ y = np.array([1.0, 2.0], dtype=np.float64)
- cl = BlankClassifier(print_progress=0, random_seed=1)
- with pytest.raises(AttributeError) as excinfo:
- cl._check_target_array(y)
-diff --git a/mlxtend/classifier/multilayerperceptron.py b/mlxtend/classifier/multilayerperceptron.py
-index 770dab9..05416c3 100644
---- a/mlxtend/classifier/multilayerperceptron.py
-+++ b/mlxtend/classifier/multilayerperceptron.py
-@@ -143,7 +143,7 @@ class MultiLayerPerceptron(
- prev_grad_b_out = np.zeros(shape=self.b_["out"].shape)
- prev_grad_w_out = np.zeros(shape=self.w_["out"].shape)
-
-- y_enc = self._one_hot(y=y, n_labels=self.n_classes, dtype=np.float_)
-+ y_enc = self._one_hot(y=y, n_labels=self.n_classes, dtype=np.float64)
-
- self.init_time_ = time()
-
-diff --git a/mlxtend/classifier/softmax_regression.py b/mlxtend/classifier/softmax_regression.py
-index 56444e5..173154e 100644
---- a/mlxtend/classifier/softmax_regression.py
-+++ b/mlxtend/classifier/softmax_regression.py
-@@ -141,7 +141,7 @@ class SoftmaxRegression(_BaseModel, _IterativeModel, _Classifier, _MultiClass):
- )
- self.cost_ = []
-
-- y_enc = self._one_hot(y=y, n_labels=self.n_classes, dtype=np.float_)
-+ y_enc = self._one_hot(y=y, n_labels=self.n_classes, dtype=np.float64)
-
- self.init_time_ = time()
- rgen = np.random.RandomState(self.random_seed)
-diff --git a/mlxtend/math/linalg.py b/mlxtend/math/linalg.py
-index 02600f1..ece4c3c 100644
---- a/mlxtend/math/linalg.py
-+++ b/mlxtend/math/linalg.py
-@@ -45,7 +45,7 @@ def vectorspace_orthonormalization(ary, eps=1e-13): # method='gram-schmidt',
- # 2c) Normalize if linearly independent,
- # and set to zero otherwise
-
-- arr = ary.astype(np.float_).copy()
-+ arr = ary.astype(np.float64).copy()
-
- for i in range(arr.shape[1]):
- for j in range(i):
-diff --git a/mlxtend/plotting/tests/test_decision_regions.py b/mlxtend/plotting/tests/test_decision_regions.py
-index fba2255..aad63ff 100644
---- a/mlxtend/plotting/tests/test_decision_regions.py
-+++ b/mlxtend/plotting/tests/test_decision_regions.py
-@@ -94,7 +94,7 @@ def test_y_int_ary():
- "Try passing the array as y.astype(np.int_)",
- plot_decision_regions,
- X[:, :2],
-- y.astype(np.float_),
-+ y.astype(np.float64),
- sr,
- )
-
---
-2.47.0
-
diff --git a/pkgs/development/python-modules/mlxtend/default.nix b/pkgs/development/python-modules/mlxtend/default.nix
index 1ee22516471f..61c4acfa2460 100644
--- a/pkgs/development/python-modules/mlxtend/default.nix
+++ b/pkgs/development/python-modules/mlxtend/default.nix
@@ -16,7 +16,7 @@
buildPythonPackage rec {
pname = "mlxtend";
- version = "0.23.3";
+ version = "0.23.4";
pyproject = true;
disabled = isPy27;
@@ -25,7 +25,7 @@ buildPythonPackage rec {
owner = "rasbt";
repo = "mlxtend";
tag = "v${version}";
- hash = "sha256-c6I0dwu4y/Td2G6m2WP/52W4noQUmQMDvpzXA9RZauo=";
+ hash = "sha256-xoAHYRmqN5SrEWlc18ntTZ6WAznBlVZdf+x5Yev3ysE=";
};
build-system = [ setuptools ];
@@ -39,11 +39,6 @@ buildPythonPackage rec {
joblib
];
- patches = [
- # https://github.com/rasbt/mlxtend/pull/1119
- ./0001-fix-test-replace-np.float_-to-np.float64.patch
- ];
-
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [ "-sv" ];