From 375a367db239f9942067e3a2f30c23a354a43fcd Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 17 Feb 2025 16:54:59 -0600 Subject: [PATCH] Fix a numpy 2 deprecation warning (dtype "a" code) --- graphblas/tests/test_dtype.py | 4 ++++ scripts/check_versions.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/graphblas/tests/test_dtype.py b/graphblas/tests/test_dtype.py index e2478fe7b..ecbca707f 100644 --- a/graphblas/tests/test_dtype.py +++ b/graphblas/tests/test_dtype.py @@ -9,6 +9,7 @@ import graphblas as gb from graphblas import core, dtypes from graphblas.core import lib +from graphblas.core.utils import _NP2 from graphblas.dtypes import lookup_dtype suitesparse = gb.backend == "suitesparse" @@ -228,6 +229,9 @@ def test_dtype_to_from_string(): # See NEP 55 about StringDtype "T". Notably, this doesn't work: # >>> np.dtype(np.dtype("T").str) continue + if _NP2 and c == "a": + # Data type alias 'a' was deprecated in NumPy 2.0. Use the 'S' alias instead. + continue try: dtype = np.dtype(c) types.append(dtype) diff --git a/scripts/check_versions.sh b/scripts/check_versions.sh index cd3451905..5aa88e045 100755 --- a/scripts/check_versions.sh +++ b/scripts/check_versions.sh @@ -7,7 +7,7 @@ conda search 'flake8-bugbear[channel=conda-forge]>=24.12.12' conda search 'flake8-simplify[channel=conda-forge]>=0.21.0' conda search 'numpy[channel=conda-forge]>=2.2.3' conda search 'pandas[channel=conda-forge]>=2.2.3' -conda search 'scipy[channel=conda-forge]>=1.15.1' +conda search 'scipy[channel=conda-forge]>=1.15.2' conda search 'networkx[channel=conda-forge]>=3.4.2' conda search 'awkward[channel=conda-forge]>=2.7.4' conda search 'sparse[channel=conda-forge]>=0.15.5'