Skip to content

Commit

Permalink
Note sub-optimal performance of cohort_statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymillar committed Dec 9, 2021
1 parent 8461b22 commit 9b1324b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sgkit/stats/popgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,9 @@ def observed_heterozygosity(
variables.validate(ds, {call_heterozygosity: variables.call_heterozygosity_spec})
hi = da.asarray(ds[call_heterozygosity])
sc = da.asarray(ds[sample_cohort])
# NOTE: Performance of cohort_statistic is substantially slower than a numba
# JIT function which handles cohorts directly (i.e. avoids slicing the
# `hi` array by cohort).
ho = cohort_statistic(
values=hi,
statistic=np.nanmean,
Expand Down

0 comments on commit 9b1324b

Please sign in to comment.