Skip to content

Commit

Permalink
fix mate eval
Browse files Browse the repository at this point in the history
  • Loading branch information
guidopetri committed Apr 20, 2024
1 parent 52991d9 commit 0e30bf3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/chess_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,21 @@ def complete(self):

counter = 0
position_count = len(no_evals['positions'])
evaluation = None

for position in no_evals['positions'].tolist():
if position in positions_evaluated.values:
# position will be dropped later if evaluation is None
evaluation = None
else:
evaluation = get_sf_evaluation(position + ' 0',
stockfish_params.location,
stockfish_params.depth)
sf_eval = get_sf_evaluation(position + ' 0',
stockfish_params.location,
stockfish_params.depth)
if sf_eval is not None:
# TODO: this is implicitly setting evaluation = last
# eval if in a checkmate position. handle this better
evaluation = sf_eval

local_evals.append(evaluation)

# progress bar stuff
Expand Down

0 comments on commit 0e30bf3

Please sign in to comment.