Skip to content

Commit 6fc68e2

Browse files
committed
chore(compte): silence division warning for ap_contiguous
1 parent a8a35c5 commit 6fc68e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/copairs/compute.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ def ap_contiguous(
398398
pr_k = tp / k
399399

400400
# Calculate average precision scores for each profile
401-
ap_scores = np.add.reduceat(pr_k * rel_k_list, cutoffs) / num_pos
401+
with np.errstate(divide="ignore", invalid="ignore"):
402+
ap_scores = np.add.reduceat(pr_k * rel_k_list, cutoffs) / num_pos
402403

403404
# Generate configurations (number of positive and total pairs)
404405
null_confs = np.stack([num_pos, counts], axis=1)

0 commit comments

Comments
 (0)