Skip to content

Tags: Self-Perfection/python-chess

Tags

v0.16.2

Toggle v0.16.2's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.16.2

Changes:

* `board.move_stack` now contains the exact move objects added with
  `Board.push()` (instead of normalized copies for castling moves).
  This ensures they can be used with `Board.variation_san()` amongst others.
* `board.ep_square` is now `None` instead of `0` for no en passant square.
* `chess.svg`: Better vector graphics for knights. Thanks to ProgramFox.
* Documentation improvements.

v0.16.1

Toggle v0.16.1's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.16.1

Bugfixes:

* Explosions in atomic chess were not destroying castling rights. Thanks to
  ProgramFOX for finding this issue.

v0.16.0

Toggle v0.16.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.16.0

Bugfixes:

* `pin_mask()`, `pin()` and `is_pinned()` make more sense when already
  in check. Thanks to Ferdinand Mosca.

New features:

* **Variant support: Suicide, Giveaway, Atomic, King of the Hill, Racing Kings,
  Horde, Three-check, Crazyhouse.** `chess.Move` now supports drops.
* More fine grained dependencies. Use *pip install python-chess[uci,gaviota]* to
  install dependencies for the full feature set.
* Added `chess.STATUS_EMPTY` and `chess.STATUS_ILLEGAL_CHECK`.
* The `board.promoted` mask keeps track of promoted pieces.
* Optionally copy boards without the move stack: `board.copy(stack=False)`.
* `examples/bratko_kopec` now supports avoid move (am), variants and
  displays fractional scores immidiately. Thanks to Daniel Dugovic.
* `perft.py` rewritten with multi-threading support and moved to
  `examples/perft`.
* `chess.syzygy.dependencies()`, `chess.syzygy.all_dependencies()` to generate
  Syzygy tablebase dependencies.

Changes:

* **Endgame tablebase probing (Syzygy, Gaviota):** `probe_wdl()` **,**
  `probe_dtz()` **and** `probe_dtm()` **now raise** `KeyError` **or**
  `MissingTableError` **instead of returning** *None*. If you prefer getting
  `None` in case  of an error use `get_wdl()`, `get_dtz()` and `get_dtm()`.
* `chess.pgn.BaseVisitor.result()` returns `True` by default and is no longer
  used by `chess.pgn.read_game()` if no game was found.
* Non-fast-forward update of the Git repository to reduce size (old binary
  test assets removed).
* `board.pop()` now uses a boardstate stack to undo moves.
* `uci.engine.position()` will send the move history only until the latest
  zeroing move.
* Optimize `board.clean_castling_rights()` and micro-optimizations improving
  PGN parser performance by around 20%.
* Syzygy tables now directly use the endgame name as hash keys.
* Improve test performance (especially on Travis CI).
* Documentation updates and improvements.

v0.15.4

Toggle v0.15.4's commit message
python-chess v0.15.4

New features:

* Highlight last move and checks when rendering board SVGs.

v0.15.3

Toggle v0.15.3's commit message
python-chess v0.15.3

Bugfixes:

* `pgn.Game.errors` was not populated as documented. Thanks to Ryan Delaney
  for reporting.

New features:

* Added `pgn.GameNode.add_line()` and `pgn.GameNode.main_line()` which make
  it easier to work with list of moves as variations.

v0.15.2

Toggle v0.15.2's commit message
python-chess v0.15.2

Bugfixes:

* Fix a bug where `shift_right()` and `shift_2_right()` were producing
  integers larger than 64bit when shifting squares off the board. This is
  very similar to the bug fixed in v0.15.1. Thanks to piccoloprogrammatore
  for reporting.

v0.15.1

Toggle v0.15.1's commit message
python-chess v0.15.1

Bugfixes:

* Fix a bug where `shift_up_right()` and `shift_up_left()` were producing
  integers larger than 64bit when shifting squares off the board.

New features:

* Replaced __html__ with experimental SVG rendering for IPython.

v0.15.0

Toggle v0.15.0's commit message
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
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
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)`.