pydata / sparse

Sparse multi-dimensional arrays for the PyData ecosystem

Home Page:https://sparse.pydata.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

elemwise raises internal DeprecationWarning (new to version 0.14.0)

eriknw opened this issue · comments

Describe the bug
Operations such as s == s results in DeprecationWarning.

To Reproduce

python -Werror -c "import numpy as np ; import sparse ; a = np.array([1, 2]) ; s = sparse.COO(a, a, shape=(3,)) ; s == s"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/erik/miniconda3/envs/graphblas-dev/lib/python3.10/site-packages/numpy/lib/mixins.py", line 21, in func
    return ufunc(self, other)
  File "/home/erik/miniconda3/envs/graphblas-dev/lib/python3.10/site-packages/sparse/_sparse_array.py", line 305, in __array_ufunc__
    result = elemwise(ufunc, *inputs, **kwargs)
  File "/home/erik/miniconda3/envs/graphblas-dev/lib/python3.10/site-packages/sparse/_umath.py", line 49, in elemwise
    return _Elemwise(func, *args, **kwargs).get_result()
  File "/home/erik/miniconda3/envs/graphblas-dev/lib/python3.10/site-packages/sparse/_umath.py", line 516, in get_result
    return COO(
  File "/home/erik/miniconda3/envs/graphblas-dev/lib/python3.10/site-packages/sparse/_coo/core.py", line 261, in __init__
    warnings.warn(
DeprecationWarning: coords should be an ndarray. This will raise a ValueError in the future.

Expected behavior
I expect to be able to do elementwise infix operators between sparse objects without deprecation warnings, since this warning appears to be coming from internal use and there is nothing the user should change.

System

  • OS and version: Ubuntu WSL on Windows
  • sparse version (sparse.__version__): 0.14.0
  • NumPy version (np.__version__): 1.23.5
  • Numba version (numba.__version__): 0.56.4