Python implementation of the game of chess.
Project description
Introduction
Performance
Using python3 -m cProfile -o prof.txt tree.py -h
for profiling and snakeviz prof.txt
to
visualize.
Perft(3) initial positions rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
(8902
positions, reference time 0.05 with python-chess
:
- 1.25 s (first)
- 0.79 s (moving
get_positions_attacking_pieces
to optimizer initialization and update, not when checking if move is legal) - 0.70 removing np.array from list of moves (does not make a lot of sense)
- 0.55 removing more np.arrays
TODO:
- [X] Include tests for perft in different positions
- [ ] Utils if there is a mismatch in positions
- [ ] Improve performance
- [ ] Improve overall code quality (clarity, choose right data structure for the job)
- [X] Automate release with github action to pip
- [ ] Explore pypy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chess-python-pip-0.1.0.tar.gz
(10.0 kB
view details)
Built Distribution
File details
Details for the file chess-python-pip-0.1.0.tar.gz
.
File metadata
- Download URL: chess-python-pip-0.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.2 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2f841ae3cd67f0574582c009eec8b6da75730be6e4e3aab7ee5ab36df91843b |
|
MD5 | 620e1ec3f1b7ebadb12aabd002ee7e90 |
|
BLAKE2b-256 | d644f19fdfb5a3390ddc207538afd9653d381cdb2f26ffed86dfa898ca6ad69c |
File details
Details for the file chess_python_pip-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: chess_python_pip-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.2 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3f91826410c3daed43491f235eec06e413edc4cb7e6735f65a340e497685143 |
|
MD5 | 1bc0f4b3eb4ad252a191bb27bce8e2ea |
|
BLAKE2b-256 | 1527c0fce0bd8832c4571c30d1ba56731425c1a3b83c22d169e1ecf66c57d4e5 |