Skip to content

Commit af44870

Browse files
committed
fix import order
1 parent d67f2cb commit af44870

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/test_metrics.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pytest
33

44
from semsearcheval.data import Result
5-
from semsearcheval.metrics import Accuracy, Latency, NDCG
5+
from semsearcheval.metrics import NDCG, Accuracy, Latency
66

77

88
@pytest.mark.parametrize(
@@ -29,8 +29,12 @@ def test_accuracy_at_k(similarity, gold_indices, k, expected):
2929
# Gold doc at rank 2 for query 0, not in top 1 for query 1
3030
# Query 0: gold=0, scores=[0,1,0] -> ranked [1,0,2] -> gold at rank 2 -> 1/log2(3)
3131
# Query 1: gold=1, scores=[0,0,1] -> ranked [2,0,1] -> gold at rank 3 -> 1/log2(4)
32-
(np.array([[0, 1, 0], [0, 0, 1]]), np.array([0, 1]), 10,
33-
(1.0 / np.log2(3) + 1.0 / np.log2(4)) / 2 * 100),
32+
(
33+
np.array([[0, 1, 0], [0, 0, 1]]),
34+
np.array([0, 1]),
35+
10,
36+
(1.0 / np.log2(3) + 1.0 / np.log2(4)) / 2 * 100,
37+
),
3438
# Gold doc outside top 1 for both -> 0%
3539
(np.array([[0, 1, 0], [0, 0, 1]]), np.array([0, 1]), 1, 0.0),
3640
],

0 commit comments

Comments
 (0)