From 43d55cf4de698c2c44baa7b5972f098764cea87e Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Thu, 3 Oct 2024 21:59:40 +0200 Subject: [PATCH 1/5] Trigger CI From b81a30377cd5c99ff9a89c30aca00be3a768af06 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Fri, 4 Oct 2024 11:07:09 +0200 Subject: [PATCH 2/5] upgrade macos --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5c4218dec..98f2b4e11 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -255,7 +255,7 @@ jobs: - template: build_tools/azure/posix.yml parameters: name: macOS - vmImage: macOS-11 + vmImage: macOS-12 dependsOn: [linting, git_commit] condition: | and( From d3e4a197d44706ed9290a139ae71e1c4495a64ac Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Fri, 4 Oct 2024 11:13:32 +0200 Subject: [PATCH 3/5] iter --- imblearn/utils/estimator_checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imblearn/utils/estimator_checks.py b/imblearn/utils/estimator_checks.py index 570427759..2fc893391 100644 --- a/imblearn/utils/estimator_checks.py +++ b/imblearn/utils/estimator_checks.py @@ -309,7 +309,7 @@ def check_samplers_sparse(name, sampler_orig): sampler = clone(sampler) X_res, y_res = sampler.fit_resample(X, y) assert sparse.issparse(X_res_sparse) - assert_allclose(X_res_sparse.A, X_res, rtol=1e-5) + assert_allclose(X_res_sparse.toarray(), X_res, rtol=1e-5) assert_allclose(y_res_sparse, y_res) From aef2845a1f7911f6d928fa4568fbe8e13789dee4 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Fri, 4 Oct 2024 15:17:39 +0200 Subject: [PATCH 4/5] array(..., copy=False) -> asarray() --- imblearn/metrics/pairwise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imblearn/metrics/pairwise.py b/imblearn/metrics/pairwise.py index 11f654f02..40f099258 100644 --- a/imblearn/metrics/pairwise.py +++ b/imblearn/metrics/pairwise.py @@ -161,7 +161,7 @@ def fit(self, X, y): f"elements in n_categories and {self.n_features_in_} in " f"X." ) - self.n_categories_ = np.array(self.n_categories, copy=False) + self.n_categories_ = np.asarray(self.n_categories) classes = unique_labels(y) # list of length n_features of ndarray (n_categories, n_classes) From 26472e5de6225d267432d2c88cf4fd21f7c47a20 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Fri, 4 Oct 2024 17:57:39 +0200 Subject: [PATCH 5/5] avoid docstring check --- conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conftest.py b/conftest.py index 45a5ce679..0dc6e5a23 100644 --- a/conftest.py +++ b/conftest.py @@ -7,7 +7,14 @@ import os +import numpy as np import pytest +from sklearn.utils.fixes import parse_version + +# use legacy numpy print options to avoid failures due to NumPy 2.+ scalar +# representation +if parse_version(np.__version__) > parse_version("2.0.0"): + np.set_printoptions(legacy="1.25") def pytest_runtest_setup(item):