Skip to content

Commit

Permalink
Test WDL consistency under all models
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Jul 27, 2023
1 parent 1cca86f commit ff1a974
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2948,9 +2948,10 @@ def test_score_ordering(self):
self.assertEqual(i >= j, a >= b)
self.assertEqual(i < j, a.score(mate_score=100000) < b.score(mate_score=100000))

self.assertTrue(not (i < j) or a.wdl().expectation() <= b.wdl().expectation())
self.assertTrue(not (i < j) or a.wdl().winning_chance() <= b.wdl().winning_chance())
self.assertTrue(not (i < j) or a.wdl().losing_chance() >= b.wdl().losing_chance())
for model in ["sf12", "sf14", "sf15", "sf15.1", "sf16"]:
self.assertTrue(not (i < j) or a.wdl(model=model).expectation() <= b.wdl(model=model).expectation())
self.assertTrue(not (i < j) or a.wdl(model=model).winning_chance() <= b.wdl(model=model).winning_chance())
self.assertTrue(not (i < j) or a.wdl(model=model).losing_chance() >= b.wdl(model=model).losing_chance())

def test_score(self):
# Negation.
Expand Down

0 comments on commit ff1a974

Please sign in to comment.