Skip to content

Commit f4fa89b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a29a9de commit f4fa89b

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

src/scanpy/get/_aggregated.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ def _sum(
9696
return utils.asarray(
9797
self.indicator_matrix @ (_power(data, 2) if power_of_2 else data)
9898
)
99-
out = np.zeros((self.indicator_matrix.shape[0], data.shape[1]), dtype="int64" if np.issubdtype(data, np.integer) else "float64")
99+
out = np.zeros(
100+
(self.indicator_matrix.shape[0], data.shape[1]),
101+
dtype="int64" if np.issubdtype(data, np.integer) else "float64",
102+
)
100103
return (agg_sum_csr if isinstance(data, CSRBase) else agg_sum_csc)(
101104
self.indicator_matrix, (_power(data, 2) if power_of_2 else data), out
102105
)

src/scanpy/get/_kernels.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111

1212

1313
@njit
14-
def agg_sum_csr(
15-
indicator: CSRBase,
16-
data: CSRBase,
17-
out: np.ndarray
18-
):
14+
def agg_sum_csr(indicator: CSRBase, data: CSRBase, out: np.ndarray):
1915
out = np.zeros((indicator.shape[0], data.shape[1]), dtype="float64")
2016
for cat_num in numba.prange(indicator.shape[0]):
2117
start_cat_idx = indicator.indptr[cat_num]
@@ -33,11 +29,7 @@ def agg_sum_csr(
3329

3430

3531
@njit
36-
def agg_sum_csc(
37-
indicator: CSRBase,
38-
data: CSCBase,
39-
out: np.ndarray
40-
):
32+
def agg_sum_csc(indicator: CSRBase, data: CSCBase, out: np.ndarray):
4133

4234
obs_to_cat = np.full(data.shape[0], -1, dtype=np.int64)
4335

0 commit comments

Comments
 (0)