You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError: 'csr_matrix' object has no attribute 'A' #36
I'm trying to run the tutorial and am receiving this error while running sdm.spatialdm_local(adata, n_perm=1000, method='both', specified_ind=None, nproc=1).
The full error is pasted below:
Traceback (most recent call last):
File "", line 1, in
sdm.spatialdm_local(adata, n_perm=1000, method='both', specified_ind=None, nproc=1)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/2/moor2562/miniconda3/envs/spatialdm/lib/python3.13/site-packages/spatialdm/main.py", line 283, in spatialdm_local
spot_selection_matrix(adata, ligand, receptor, ind, n_perm, method, scale_X)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/2/moor2562/miniconda3/envs/spatialdm/lib/python3.13/site-packages/spatialdm/utils.py", line 245, in spot_selection_matrix
raw_norm.X = csr_matrix([norm_max(X) for X in raw_norm.X.T]).T
~~~~~~~~^^^
File "/users/2/moor2562/miniconda3/envs/spatialdm/lib/python3.13/site-packages/spatialdm/utils.py", line 235, in norm_max
X=X.A[0]
^^^
AttributeError: 'csr_matrix' object has no attribute 'A'
I'm not an expert by any means, but I think the issue might be stemming from incompatibilities with the updated syntax of the scipy.sparse function in manipulating the csr_matrix.
Activity
moor2562 commentedon May 1, 2025
I'm not an expert by any means, but I think the issue might be stemming from incompatibilities with the updated syntax of the scipy.sparse function in manipulating the csr_matrix.