Releases: niklasf/python-chess
Releases · niklasf/python-chess
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.
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)`.
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.
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()`.
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)`.
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.
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.
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.
python-chess v0.12.3
Bugfixes: * Some invalid castling rights were silently ignored by `Board.set_fen()`. Now it is ensured information is stored for retrieval using `Board.status()`.
python-chess v0.12.2
Bugfixes: * Some Gaviota probe results were incorrect for positions where black could capture en passant.