Since chess uci is no longer supported, what is a simple fix for older code that uses this module? #848
Answered
by
niklasf
infinitless
asked this question in
Q&A
-
|
Question says it all. Was trying to run this https://github.com/mptedesco/python-chess-analysis but then ran into chess.uci not existing. Is there an easy fix? Also notified the author so any comments might help them too! |
Beta Was this translation helpful? Give feedback.
Answered by
niklasf
Jan 12, 2022
Replies: 1 comment 4 replies
-
|
The new
|
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
infinitless
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The new
chess.enginemodule can do everything thatchess.ucicould and vice versa, but there is no mechanical recipe to convert fromchess.ucitochess.engine. However, usually the process is straight-foward. In this case:chess.uci.popen_engine(path)becomeschess.engine.SimpleEngine.popen_uci(path), if you do not intend to useasyncio.InfoHandlerhas been removed. No need to register one, anymore.engine.position(board)andengine.go(time=time_in_millis)for the purpose of analysis is now a single callinfo = engine.analyse(board, chess.engine.Limit(time=time_in_seconds)).info["pv"][0]is the best move according to the engine.info["score"]will be aPovScore, that you can use to get…