From 43f0ebe1da5280e5fb5fb71a09a1e9288879f89c Mon Sep 17 00:00:00 2001 From: johndoknjas Date: Sat, 1 Jun 2024 23:49:09 -0700 Subject: [PATCH] Minor updates to `get_wdl_stats` related stuff. --- README.md | 2 +- stockfish/models.py | 4 +--- tests/stockfish/test_models.py | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c8ef486..e31a2b4 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ Before calling this function, it is recommended that you first check if your ver use the "does_current_engine_version_have_wdl_option()" function below. ```python -stockfish.get_wdl_stats() +stockfish.get_wdl_stats() # include the argument get_as_tuple=True if you'd like to have a tuple returned instead of a list. ``` ```text diff --git a/stockfish/models.py b/stockfish/models.py index d528403..ab86ce4 100644 --- a/stockfish/models.py +++ b/stockfish/models.py @@ -706,9 +706,7 @@ def is_move_correct(self, move_value: str) -> bool: self.info = old_self_info return is_move_correct - def get_wdl_stats( - self, get_as_tuple: bool = False - ) -> Union[list[int] | tuple[int, int, int] | None]: + def get_wdl_stats(self, get_as_tuple: bool = False) -> list[int] | tuple[int, int, int] | None: """Returns Stockfish's win/draw/loss stats for the side to move. Args: diff --git a/tests/stockfish/test_models.py b/tests/stockfish/test_models.py index 70303f9..fbd5390 100644 --- a/tests/stockfish/test_models.py +++ b/tests/stockfish/test_models.py @@ -914,6 +914,7 @@ def test_get_wdl_stats(self, stockfish: Stockfish): wdl_stats_3 = stockfish.get_wdl_stats() assert isinstance(wdl_stats_3, list) and len(wdl_stats_3) == 3 + stockfish._prepare_for_new_position() wdl_stats_4 = stockfish.get_wdl_stats(get_as_tuple=True) assert isinstance(wdl_stats_4, tuple) and len(wdl_stats_4) == 3 assert wdl_stats_3 == list(wdl_stats_4)