Skip to content

Commit

Permalink
Minor updates to get_wdl_stats related stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoknjas committed Jun 2, 2024
1 parent c70c763 commit 43f0ebe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions stockfish/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions tests/stockfish/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 43f0ebe

Please sign in to comment.