Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dustalov committed Jun 17, 2024
1 parent 845dd6e commit 4b084b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/evalica/evalica.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import numpy.typing as npt

def py_bradley_terry(
m: npt.NDArray[np.int64]
) -> Tuple[int, npt.NDArray[np.float64]]: ...
) -> Tuple[npt.NDArray[np.float64], int]: ...

def py_newman(
m: npt.NDArray[np.int64],
seed: int,
tolerance: float,
max_iter: int
) -> Tuple[int, npt.NDArray[np.float64]]: ...
) -> Tuple[npt.NDArray[np.float64], int]: ...
9 changes: 4 additions & 5 deletions python/evalica/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class TestUnordered(unittest.TestCase):
@classmethod
def setUp(self) -> None:
self.M: npt.NDArray[np.int64] = np.array([
[0, 1, 2, 0, 1],
Expand All @@ -22,14 +21,14 @@ def setUp(self) -> None:
def test_bradley_terry(self) -> None:
p, iterations = evalica.bradley_terry(self.M)

assert np.isfinite(p).all()
assert iterations > 0
self.assertTrue(np.isfinite(p).all())
self.assertGreater(iterations, 0)

def test_newman(self) -> None:
p, iterations = evalica.newman(self.M, 0, 1e-6, 100)

assert np.isfinite(p).all()
assert iterations > 0
self.assertTrue(np.isfinite(p).all())
self.assertGreater(iterations, 0)


if __name__ == '__main__':
Expand Down

0 comments on commit 4b084b2

Please sign in to comment.