From 9e9abc87251635cc5078a938d87779838a094c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Tue, 6 Feb 2024 17:08:50 +0100 Subject: [PATCH 1/2] [scipy-dev] fix for scipy dev attr renaming --- sklearn/utils/tests/test_validation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sklearn/utils/tests/test_validation.py b/sklearn/utils/tests/test_validation.py index ee26772d8731b..8ec026db01689 100644 --- a/sklearn/utils/tests/test_validation.py +++ b/sklearn/utils/tests/test_validation.py @@ -656,11 +656,13 @@ def X_64bit(request): X = sp.rand(20, 10, format=request.param) if request.param == "coo": - if hasattr(X, "indices"): + if hasattr(X, "coords"): # for scipy >= 1.13 .indices is a new attribute and is a tuple. The # .col and .row attributes do not seem to be able to change the # dtype, for more details see https://github.com/scipy/scipy/pull/18530/ - X.indices = tuple(v.astype("int64") for v in X.indices) + # Also indices was renamed to coords in + # https://github.com/scipy/scipy/pull/20003 + X.coords = tuple(v.astype("int64") for v in X.coords) else: # scipy < 1.13 X.row = X.row.astype("int64") From cd8305a042f207880f05c3a1d0ee6e70ed461750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Tue, 6 Feb 2024 17:24:47 +0100 Subject: [PATCH 2/2] [scipy-dev] Tweak comment --- sklearn/utils/tests/test_validation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sklearn/utils/tests/test_validation.py b/sklearn/utils/tests/test_validation.py index 8ec026db01689..292c2cbbde95d 100644 --- a/sklearn/utils/tests/test_validation.py +++ b/sklearn/utils/tests/test_validation.py @@ -657,11 +657,11 @@ def X_64bit(request): if request.param == "coo": if hasattr(X, "coords"): - # for scipy >= 1.13 .indices is a new attribute and is a tuple. The + # for scipy >= 1.13 .coords is a new attribute and is a tuple. The # .col and .row attributes do not seem to be able to change the # dtype, for more details see https://github.com/scipy/scipy/pull/18530/ - # Also indices was renamed to coords in - # https://github.com/scipy/scipy/pull/20003 + # and https://github.com/scipy/scipy/pull/20003 where .indices was + # renamed to .coords X.coords = tuple(v.astype("int64") for v in X.coords) else: # scipy < 1.13