Skip to content

Commit

Permalink
Explicitly cast indices and indptr of final backed file to int64. (#17)
Browse files Browse the repository at this point in the history
For the background on this: scverse/anndata#453
  • Loading branch information
Abdul-Moeed authored Nov 20, 2020
1 parent ab9c5c7 commit b54cdb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sfaira/data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,10 @@ def load_all_tobacked(
self.adata.filename = fn_backed # setting this attribute switches this anndata to a backed object
# Note that setting .filename automatically redefines .X as dense, so we have to redefine it as sparse:
if not as_dense:
self.adata.X = scipy.sparse.csr_matrix(self.adata.X) # redefines this backed anndata as sparse
X = scipy.sparse.csr_matrix(self.adata.X) # redefines this backed anndata as sparse
X.indices = X.indices.astype(np.int64)
X.indptr = X.indptr.astype(np.int64)
self.adata.X = X
keys = [
"lab",
"year",
Expand Down

0 comments on commit b54cdb5

Please sign in to comment.