-
v0.15.0eb635897 · ·
python-chess v0.15.0 Changes: * `chess.uci.Score` **no longer has** `upperbound` **and** `lowerbound` **attributes**. Previously these were always false. * Significant improvements of move generation speed, around **2.3x faster PGN parsing**. Removed the following internal attributes and methods of the `Board` class: `attacks_valid`, `attacks_to`, `attacks_from`, `_pinned()`, `attacks_valid_stack`, `attacks_from_stack`, `attacks_to_stack`, `generate_attacks()`. * UCI: Do not send *isready* directly after go. Though allowed by the UCI protocol specification it is just not nescessary and many engines were having trouble with this. * Polyglot: Use less memory for uniform random choices from big opening books (reservoir sampling). * Documentation improvements. Bugfixes: * Allow underscores in PGN header tags. Found and fixed by Bajusz Tamás. New features: * Added `Board.chess960_pos()` to identify the Chess960 starting position number of positions. * Added `chess.BB_BACKRANKS` and `chess.BB_PAWN_ATTACKS`.
-
v0.14.14a7daa8b · ·
python-chess v0.14.1 Bugfixes: * Backport Bugfix for Syzygy DTZ related to en-passant. See official-stockfish/Stockfish@6e2ca97d93812b2. Changes: * Added optional argument *max_fds=128* to `chess.syzygy.open_tablebases()`. An LRU cache is used to keep at most *max_fds* files open. This allows using many tables without running out of file descriptors. Previously all tables were opened at once. * Syzygy and Gaviota now store absolute tablebase paths, in case you change the working directory of the process. * The default implementation of `chess.uci.InfoHandler.score()` will no longer store score bounds in `info["score"]`, only real scores. * Added `Board.set_chess960_pos()`. * Documentation improvements.
-
v0.14.0f0d5573e · ·
python-chess v0.14.0 Changes: * `Board.attacker_mask()` **has been renamed to** `Board.attackers_mask()` for consistency. * **The signature of** `Board.generate_legal_moves()` **and** `Board.generate_pseudo_legal_moves()` **has been changed.** Previously it was possible to select piece types for selective move generation: `Board.generate_legal_moves(castling=True, pawns=True, knights=True, bishops=True, rooks=True, queens=True, king=True)` Now it is possible to select arbitrary sets of origin and target squares. `to_mask` uses the corresponding rook squares for castling moves. `Board.generate_legal_moves(from_mask=BB_ALL, to_mask=BB)` To generate all knight and queen moves do: `board.generate_legal_moves(board.knights | board.queens)` To generate only castling moves use: `Board.generate_castling_moves(from_mask=BB_ALL, to_mask=BB_ALL)` * Additional hardening has been added on top of the bugfix from v0.13.3. Diagonal skewers on the last double pawn move are now handled correctly, even though such positions can not be reached with a sequence of legal moves. * `chess.syzygy` now uses the more efficient selective move generation. New features: * The following move generation methods have been added: `Board.generate_pseudo_legal_ep(from_mask=BB_ALL, to_mask=BB_ALL)`, `Board.generate_legal_ep(from_mask=BB_ALL, to_mask=BB_ALL)`, `Board.generate_pseudo_legal_captures(from_mask=BB_ALL, to_mask=BB_ALL)`, `Board.generate_legal_captures(from_mask=BB_ALL, to_mask=BB_ALL)`.
-
v0.13.345de671a · ·
python-chess v0.13.3 **This is a bugfix release for a move generation bug.** Other than the bugfix itself there are only minimal fully backwardscompatible changes. You should update immediately. Bugfixes: * When capturing en passant, both the capturer and the captured pawn disappear from the fourth or fifth rank. If those pawns were covering a horizontal attack on the king, then capturing en passant should not have been legal. `Board.generate_legal_moves()` and `Board.is_into_check()` have been fixed. The same principle applies for diagonal skewers, but nothing has been done in this release: If the last double pawn move covers a diagonal attack, then the king would have already been in check. v0.14.0 adds additional hardening for all cases. It is recommended you upgrade to v0.14.0 as soon as you can deal with the non-backwards compatible changes. Changes: * `chess.uci` now uses `subprocess32` if applicable (and available). Additionally a lock is used to work around a race condition in Python 2, that can occur when spawning engines from multiple threads at the same time. * Consistently handle tabs in UCI engine output.
-
v0.13.20e22d49f · ·
python-chess v0.13.2 Changes: * `chess.syzygy.open_tablebases()` now raises if the given directory does not exist. * Allow visitors to handle invalid `FEN` tags in PGNs. * Gaviota tablebase probing fails faster for piece counts > 5. Minor new features: * Added `chess.pgn.Game.from_board()`.
-
v0.13.1e572a783 · ·
python-chess v0.13.1 Changes: * Missing *SetUp* tags in PGNs are ignored. * Incompatible comparisons on `chess.Piece`, `chess.Move`, `chess.Board` and `chess.SquareSet` now return *NotImplemented* instead of *False*. Minor new features: * Factored out basic board operations to `chess.BaseBoard`. This is inherited by `chess.Board` and extended with the usual move generation features. * Added optional *claim_draw* argument to `chess.Base.is_game_over()`. * Added `chess.Board.result(claim_draw=False)`. * Allow `chess.Board.set_piece_at(square, None)`. * Added `chess.SquareSet.from_square(square)`.
-
v0.13.06024f42e · ·
python-chess v0.13.0 * `chess.pgn.Game.export()` and `chess.pgn.GameNode.export()` have been removed and replaced with a new visitor concept. * `chess.pgn.read_game()` no longer takes an `error_handler` argument. Errors are now logged. Use the new visitor concept to change this behaviour.
-
v0.12.51ab19327 · ·
python-chess v0.12.5 Bugfixes: * Context manager support for pure Python Gaviota probing code. Various documentation fixes for Gaviota probing. Thanks to Jürgen Précour for reporting. * PGN variation start comments for variations on the very first move were assigned to the game. Thanks to Norbert Räcke for reporting.
-
v0.12.438282816 · ·
python-chess v0.12.4 Bugfixes: * Another en passant related Bugfix for pure Python Gaviota tablebase probing. New features: * Added `pgn.GameNode.is_end()`. Changes: * Big speedup for `pgn` module. Boards are cached less agressively. Board move stacks are copied faster. * Added tox.ini to specify test suite and flake8 options.
-
v0.11.1e5dee27c · ·
python-chess v0.11.1 Bugfixes: * `syzygy.Tablebases.probe_dtz()` has was giving wrong results for some positions with possible en passant capturing. This was found and fixed upstream: https://github.com/official-stockfish/Stockfish/issues/394. * Ignore extra spaces in UCI `info` lines, as for example sent by the Hakkapeliitta engine. Thanks to Jürgen Précour for reporting
-
v0.11.06f545f55 · ·
python-chess v0.11.0 Changes: * **Chess960** support and the **representation of castling moves** has been changed. The constructor of board has a new `chess960` argument, defaulting to `False`: `Board(fen=STARTING_FEN, chess960=False)`. That property is available as `Board.chess960`. In Chess960 mode the behaviour is as in the previous release. Castling moves are represented as a king move to the corresponding rook square. In the default standard chess mode castling moves are represented with the standard UCI notation, e.g. `e1g1` for king-side castling. `Board.uci(move, chess960=None)` creates UCI representations for moves. Unlike `Move.uci()` it can convert them in the context of the current position. `Board.has_chess960_castling_rights()` has been added to test for castling rights that are impossible in standard chess. The modules `chess.polyglot`, `chess.pgn` and `chess.uci` will transparently handle both modes. * In a previous release `Board.fen()` has been changed to only display an en passant square if a legal en passant move is indeed possible. This has now also been adapted for `Board.shredder_fen()` and `Board.epd()`. New features: * Get individual FEN components: `Board.board_fen()`, `Board.castling_xfen()`, `Board.castling_shredder_fen()`. * Use `Board.has_legal_en_passant()` to test if a position has a legal en passant move. * Make `repr(board.legal_moves)` human readable.