Skip to content

Commit

Permalink
Revert "test changing make moves"
Browse files Browse the repository at this point in the history
This reverts commit 23edf92.
  • Loading branch information
johndoknjas committed Aug 29, 2024
1 parent e8ee416 commit b0595c8
Show file tree
Hide file tree
Showing 3 changed files with 1,243 additions and 22 deletions.
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool:pytest]
addopts = -ra -q -s --cov-report term-missing --cov-branch --cov-report xml --cov-report term
--cov=stockfish -vv --strict-markers -rfE --maxfail=1
addopts = -ra -q --cov-report term-missing --cov-branch --cov-report xml --cov-report term
--cov=stockfish -vv --strict-markers -rfE
markers=slow

testpaths =
Expand Down
17 changes: 2 additions & 15 deletions stockfish/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,6 @@ def get_top_moves(
num_top_moves: int = 5,
verbose: bool = False,
num_nodes: int = 0,
wtime: Optional[int] = None,
btime: Optional[int] = None,
) -> List[dict]:
"""Returns info on the top moves in the position.
Expand Down Expand Up @@ -896,19 +894,14 @@ def get_top_moves(

# start engine. will go until reaches self._depth or self._num_nodes
if num_nodes == 0:
if wtime is None and btime is None:
self._go()
else:
self._go_remaining_time(wtime, btime)
self._go()
else:
self._num_nodes = num_nodes
self._go_nodes()

lines: List[List[str]] = [
line.split(" ") for line in self._get_sf_go_command_output()
]
for line in lines:
print(" ".join(line) + "\n")

# Stockfish is now done evaluating the position,
# and the output is stored in the list 'lines'
Expand All @@ -935,11 +928,7 @@ def get_top_moves(
break

# if we're searching depth and the line is not our desired depth, we're done
if (
(num_nodes == 0)
and (wtime is None and btime is None)
and (int(self._pick(line, "depth")) != self._depth)
):
if (num_nodes == 0) and (int(self._pick(line, "depth")) != self._depth):
break

# if we're searching nodes and the line has less than desired number of nodes, we're done
Expand Down Expand Up @@ -981,8 +970,6 @@ def get_top_moves(

# add move to list of top moves
top_moves.insert(0, move_evaluation)
if self._pick(line, "multipv") == 1:
break

# reset MultiPV to global value
if old_multipv != self._parameters["MultiPV"]:
Expand Down
Loading

0 comments on commit b0595c8

Please sign in to comment.