odlgroup / odl

Operator Discretization Library https://odlgroup.github.io/odl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scipy warning with BroadcastOperator and sparse matrices

joaquimcampos opened this issue · comments

I get the following warning from scipy/sparse/sputils.py:

"sputils.py:115: UserWarning: object dtype is not supported by sparse matrices
warnings.warn("object dtype is not supported by sparse matrices")" text
.

I am using python 3.7.
Code to reproduce:

import numpy as np
from odl import BroadcastOperator
from odl.operator.tensor_ops import MatrixOperator
from scipy import sparse

A = np.array([[1., 0., 0.], [0., 2., 0.]])
B = np.array([[0., 3., 0.], [4., 0., 0.]])
A_op = MatrixOperator(A)
B_op = MatrixOperator(B)

stack_op = BroadcastOperator(A_op, B_op)

Since SciPy 1.9.0 sparse matrices with objectdatatype have been deprecated completely (scipy/scipy#15828) and now this issue breaks BroadcastOperator and many examples/use cases that require it.