Skip to content

Tags: G10DRAS/python-chess

Tags

v0.15.0

Toggle v0.15.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.1

Toggle v0.14.1's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.0

Toggle v0.14.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.3

Toggle v0.13.3's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.2

Toggle v0.13.2's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.1

Toggle v0.13.1's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.0

Toggle v0.13.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.5

Toggle v0.12.5's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.4

Toggle v0.12.4's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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.12.3

Toggle v0.12.3's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
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()`.