Skip to content

Commit

Permalink
Update src/rapids_singlecell/preprocessing/_hvg.py
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp A. <[email protected]>
  • Loading branch information
Intron7 and flying-sheep authored Dec 17, 2024
1 parent 3cbd56c commit 14268c5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/rapids_singlecell/preprocessing/_hvg.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,8 @@ def in_bounds(

def _hvg_expm1(X):
if isinstance(X, DaskArray):
if isinstance(X._meta, cp.ndarray):
X = X.map_blocks(lambda X: cp.expm1(X), meta=_meta_dense(X.dtype))
elif isinstance(X._meta, csr_matrix):
X = X.map_blocks(lambda X: X.expm1(), meta=_meta_sparse(X.dtype))
meta = _meta_sparse if isinstance(X._meta, csr_matrix) else _meta_dense
X = X.map_blocks(_hvg_expm1, meta=meta(X.dtype))
else:
X = X.copy()
if issparse(X):
Expand Down

0 comments on commit 14268c5

Please sign in to comment.