mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-06 14:23:06 +02:00
Fixed violations: - PERF401: Use list comprehension (downloadCats, split) - SIM102: Combine nested if statements (keyboardCoop) - SIM113: Use enumerate (lichess_bot/tests) - B904: Add 'from None/e' to raises (engine, stockfish_analysis, generate_blunder_tests) - TRY300: Move return to else block (screen_locker) Per-file ignores added for TRY301: - lichess_bot/main.py: Null checks on subprocess streams - randomize_numbers/random_digits.py: Input validation Removed from global ignore (no violations): - RUF005, SIM103, SIM105, SIM108 Global ignore now only contains unavoidable conflicts: - D203/D213: Docstring style conflicts - COM812/ISC001: Formatter conflicts (per ruff docs) |
||
|---|---|---|
| .. | ||
| analyze_chess_game.py | ||
| README.md | ||
| requirements.txt | ||
| run.sh | ||
Chess move analysis with Stockfish
This utility parses a PGN (or a log that contains a PGN section) and evaluates each move with a local Stockfish engine, printing a per-move quality rating.
Install
Install python dependencies:
pip install -r PYTHON/stockfish_analysis/requirements.txt
Ensure Stockfish is installed and available in your PATH (or provide the path via --engine). On Linux, you can typically install with your package manager or download a binary.
Run
From the repo root:
python3 PYTHON/analyze_chess_game.py lichess_bot_game_8GSdY3Ci.log
Options:
--engine /path/to/stockfishto specify a custom engine path--time 0.2seconds per evaluation (default)--depth 12fixed depth instead of time
The script prints a table with, for each ply:
- side to move, SAN move, eval before/after from mover's POV, delta, classification, and Stockfish best move suggestion.