Closed michalk8 closed 2 years ago
Update: happens when the connectivities are a subtype of anndata._core.views.SparseCSRView
. Am also wondering, why it creates the view, since we're subsetting along var-axis, not obs-axis.
Looks like a wrong assumption, as _view_args
can be `None. The stack is (deepest first):
_ViewMixin.__init__
, anndata/_core/views.py:56_cs_matrix._with_data
, scipy/sparse/compressed.py:1218_data_matrix.copy
, scipy/sparse/data.py:92AlignedMapping.copy
, anndata/_core/aligned_mapping.py:87AnnData._mutated_copy
, anndata.py:1446AnnData.copy
, anndata.py:1499The purpose of _with_data
is to create a new object instead of a view, so maybe we need to override it in SparseCSRView
and SparseCSCView
to use the underlying cs*_matrix
class instead of self.__class__
.
I recall this being a problem in the past too, though don't remember the specifics.
Fixes would be welcome.
Traceback
Version:
0.7.7.dev17+g4564d1b