Skip to content

Commit

Permalink
remove double R conv
Browse files Browse the repository at this point in the history
  • Loading branch information
Intron7 committed Apr 19, 2024
1 parent d9b638e commit 3e8fdb4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scanpy/preprocessing/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ def sparse_mean_var_minor_axis(
sum_minor = sums_minor[:, c].sum()
means[c] = sum_minor / major_len
variances[c] = (

Check warning on line 111 in scanpy/preprocessing/_utils.py

View check run for this annotation

Codecov / codecov/patch

scanpy/preprocessing/_utils.py#L94-L111

Added lines #L94 - L111 were not covered by tests
(squared_sums_minor[:, c].sum() / major_len - (sum_minor / major_len) ** 2)
* major_len
/ (major_len - 1)
squared_sums_minor[:, c].sum() / major_len - (sum_minor / major_len) ** 2
)
return means, variances

Expand Down Expand Up @@ -141,9 +139,7 @@ def sparse_mean_var_major_axis(data, indptr, *, major_len, minor_len, n_threads)
for c in numba.prange(major_len):
mean = means[c] / minor_len
means[c] = mean
variances[c] = (
(variances[c] / minor_len - mean * mean) * minor_len / (minor_len - 1)
)
variances[c] = variances[c] / minor_len - mean * mean

Check warning on line 142 in scanpy/preprocessing/_utils.py

View check run for this annotation

Codecov / codecov/patch

scanpy/preprocessing/_utils.py#L129-L142

Added lines #L129 - L142 were not covered by tests
return means, variances


Expand Down

0 comments on commit 3e8fdb4

Please sign in to comment.