odlgroup / odl

Operator Discretization Library https://odlgroup.github.io/odl/
Mozilla Public License 2.0
374 stars 105 forks source link

scipy warning with BroadcastOperator and sparse matrices #1607

Open joaquimcampos opened 3 years ago

joaquimcampos commented 3 years ago

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)
askorikov commented 2 years ago

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

styada commented 2 days ago

Any fixes or workarounds folks have found?

leftaroundabout commented 1 day ago

@styada This issue should be gone with odl-0.8, thanks to Paul's work in https://github.com/odlgroup/odl/pull/1642.

styada commented 1 day ago

Looks like my install of odl brought in a version before the changes but I checked out his work thank you again!

Le ven. 22 nov. 2024 à 4:19 AM, Justus Sagemüller @.***> a écrit :

@styada https://github.com/styada This issue should be gone with odl-0.8, thanks to Paul's work in #1642 https://github.com/odlgroup/odl/pull/1642.

— Reply to this email directly, view it on GitHub https://github.com/odlgroup/odl/issues/1607#issuecomment-2493408861, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTKEEQAPPPERNOUKLSUWPD2B4AK5AVCNFSM6AAAAABSISTYNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJTGQYDQOBWGE . You are receiving this because you were mentioned.Message ID: @.***>