Skip to content

Commit c929fc6

Browse files
committed
Pin chess to 1.10 and fix score eval
1 parent aa0029a commit c929fc6

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ Currently, the following platforms are under development:
2020
| USB | x | x | x | x |
2121
| Bluetooth LE | x | x | |
2222

23+
## State of the project
24+
25+
- This project in it's current state depends on flask 1.x, which has known security issues. The websockets library used only supports flask 1.
26+
- The python library used for bluetooth supports only Linux, an platform independent alternative is available with `bleak`, but prefers async model.
27+
- The whole project should probably move to using async model, but that requires a major rewrite.
28+
2329
## Installation instructions
2430

2531
The project requires Python 3.7 and later (tested with 3.11). Please use a Python virtual environment to install the dependencies:

mchess/async_uci_agent.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,12 @@ async def async_go(self, board, mtime, ponder=False, analysis=False):
340340
}
341341
if 'score' in info:
342342
try:
343-
if info['score'].is_mate():
344-
sc = str(info['score'])
345-
else:
346-
cp = float(str(info['score']))/100.0
347-
sc = '{:.2f}'.format(cp)
343+
# if info['score'].is_mate():
344+
# sc = str(info['score'])
345+
# else:
346+
# cp = float(str(info['score']))/100.0
347+
# sc = '{:.2f}'.format(cp)
348+
sc = info['score'].relative.score(mate_score=10000) / 100.0
348349
except Exception as e:
349350
self.log.error(
350351
f"Score transform failed {info['score']}: {e}")

mchess/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# https://docs.python.org/3/tutorial/venv.html
22

33
pyserial
4-
chess
4+
chess==1.10.0
55
pillow
66
# bluepy
77

0 commit comments

Comments
 (0)