profile
viewpoint

ddugovic/Stockfish 92

Multi-variant fork of popular UCI chess engine

niklasf/build-raspbian-image 38

Builds a minimal Raspbian Stretch image

niklasf/chessops 24

Chess and chess variant rules and operations in TypeScript

agentcontest/massim_2018 16

Simulation platform for the Multi-Agent Programming Contest 2016 - 2018

agentcontest/massim_2019 15

The MASSim server 2019 edition

agentcontest/massim_2020 12

Simulation platform for the Multi-Agent Programming Contest 2020

niklasf/antichess-tree-server 2

HTTP API and C library to query Watkins antichess proof tables: 1. e3 is winning for White

niklasf/android-barcode-scanner 1

Use an android device as a wireless barcode scanner

niklasf/birthdays 1

The Drupal Birthdays module

niklasf/cig-lectures 1

Seat reservations for CIG lectures at TU Clausthal

issue commentniklasf/python-chess

is_game_over() of chess.Board() detects 3-fold repetition and returns True only after 8 repetitions

I think it works: https://github.com/niklasf/python-chess/blob/f3ca606934cd2cd9b1baff81008720e00e1d640e/test.py#L1168-L1219

Please show the relevant portion of your code. That should help identify the mistake, whether in your code or this library.

Are you using claim_draw=True?

PedanticHacker

comment created time in 7 hours

issue openedniklasf/python-chess

See if the maintainer of https://pypi.org/project/chess/ would be willing to give up the namespace

Attemps to contact:

  • Via GitHub issue on 2020-10-23: https://github.com/doismellburning/chess/issues/3

  • Via email on 2020-04-19:

    Hi Kristian,

    Hope you are doing well. I figured I'd give it another shot and ask if you'd be willing to consider giving up the https://pypi.org/project/chess/ namespace in favor of my library https://github.com/niklasf/python-chess.

    Best, Niklas

  • Via email on 2018-07-25:

    Hi there,

    author of python-chess here. I noticed you own "chess" on PyPI and that it doesn't seem to be under active development.

    I currently use https://pypi.org/project/python-chess/ to publish my library (developed on https://github.com/niklasf/python-chess), probably the most widely used chess library for Python. pip install python-chess -> pip install chess would be a small but nice improvement.

    Would you consider transferring https://pypi.org/project/chess/? Don't worry if you have plans for it or if you just want to keep the name.

    Best regards, Niklas

created time in 2 days

issue openeddoismellburning/chess

Rearding https://pypi.org/project/chess/

Hi there,

a few years ago I tried to contact you via email, regarding https://pypi.org/project/chess/. Since I could not reach you, I figured I'll try again via this channel.

This project appears to be unmaintained. Meanwhile the namespace would be really useful for my library https://github.com/niklasf/python-chess (currently published as https://pypi.org/project/python-chess/), which offers a superset of the functionality.

Would you consider giving up the namespace?

Apologies if you have other plans for the package. Just let me know if you do not wish to be contaced about this again.

Best, Niklas

created time in 2 days

push eventniklasf/cig-lectures

Niklas Fiekas

commit sha 37b48b18158c2b7d9cadde13f34ebe7597ee47ca

fix cursor scoping

view details

push time in 2 days

IssuesEvent

issue commentornicar/lila

Chess Insights VS Lichess API : Lacking games on Italian Opening (C50)

Yes. Can you try to click the "Update insights" button? If the analysed game does not appear, something else must be going on. Please let me know and I'll reopen in that case.

remi-picard

comment created time in 2 days

push eventniklasf/cig-lectures

Niklas Fiekas

commit sha 489231e1b4d2cda238ccf1554a6f388b8b94ebc4

number questions

view details

push time in 2 days

push eventniklasf/cig-lectures

Niklas Fiekas

commit sha 3a8b0e9a28d840b28923994c13e015a265a1f264

render example quiz

view details

Niklas Fiekas

commit sha bf057aff595282d5e9df1a04d444586f741de655

duplicate login flow for quiz

view details

Niklas Fiekas

commit sha 49c88abb02fc9de1d56043cf3c03eef5a7eeb0b6

write quiz submission crud

view details

Niklas Fiekas

commit sha 3292f3d06ef1f00eef14b92828ce06ff1928c836

create database schema

view details

Niklas Fiekas

commit sha ca2f9493de65f3ee96ac92a1e0c0206e5c2654e5

quiz almost complete

view details

Niklas Fiekas

commit sha 3749164070d5b3beeac5faad0d61f2b4b5d28326

quiz db fixes

view details

Niklas Fiekas

commit sha 385ba52965e2ffcc01aa55e6ca3352af066b4b0a

finalize quiz

view details

Niklas Fiekas

commit sha 4150d4c83d227eea91deab2d3b02edcc528ae8f4

more explanatory text for quiz

view details

push time in 2 days

issue commentniklasf/lila-gif

Add a frame at the end showing the result for the GIF generation

Apparently Twitter shortens the last frame, which makes it hard to see the final position. Adding another frame would work around that, too.

l3d00m

comment created time in 2 days

push eventniklasf/python-chess

Boštjan Mejak

commit sha f3ca606934cd2cd9b1baff81008720e00e1d640e

Fix CHANGELOG.rst Added a hyphen and a comma.

view details

push time in 2 days

PR merged niklasf/python-chess

Fix CHANGELOG.rst

Added a hyphen and a comma.

+2 -2

0 comment

1 changed file

PedanticHacker

pr closed time in 2 days

push eventniklasf/python-tinyhtml

Niklas Fiekas

commit sha 13bc3760b339e56764591a4ad7996e84bf0259d4

add line between examples

view details

push time in 2 days

push eventniklasf/python-tinyhtml

Niklas Fiekas

commit sha 8ec0c6f669c5a92359bae12d94a2e9d022039ddc

update a comment

view details

Niklas Fiekas

commit sha 639c81a216bbb0a323e1fd180d7fd2307442e2f0

doctest escaping

view details

push time in 2 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 133aa36028c8d635c0f36c0695c068eebc86e1ea

Fix a missed delayed type annotation

view details

push time in 3 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 16e6543466f1982b4074c94580858495f39ccbd0

Some post hoc changelog fixes for 1.2.0

view details

push time in 3 days

push eventniklasf/python-tinyhtml

Niklas Fiekas

commit sha 3da8df31c7a4039f71f1cbec14ae6468ef1d1424

reject bytes also in attributes

view details

push time in 3 days

push eventniklasf/python-tinyhtml

Niklas Fiekas

commit sha 79733ad17557e7b27a9b1e25bc4bc3201892e5c0

raise TypeError when rendering bytes

view details

push time in 3 days

push eventniklasf/python-chess

Boštjan Mejak

commit sha 1164b787ce9f5209f695667ed15e56c3498e154d

Fix some commas and words Found some bad apples and threw them away.

view details

push time in 3 days

PR merged niklasf/python-chess

Fix some commas and words

Found some bad apples and threw them away.

+3 -3

0 comment

1 changed file

PedanticHacker

pr closed time in 3 days

IssuesEvent

push eventlichess-org/api

ornicar

commit sha 8d78cf11f76e98eb277521a46e22869240e24acc

Deploy to GitHub Pages

view details

push time in 3 days

issue commentornicar/lila

Light scrollbar in timeline in dark mode

The scrollbar color for the other boxes is chosen by a heuristic, based on their background color. Somehow Firefox does not realize that the background of this one is also dark. Explicitly setting something like background: black on .timeline works. Unfortunately no solid color will do, because it can overlap with the gradient in the background.

tmmlaarhoven

comment created time in 3 days

issue closedornicar/lila

Lacking games in "Chess insights"

Chess insights isn't taking into account all of a player's rated games, without any apparent reason. This problem was reported by several other players.

According to my profile page, at this moment I played a total of 132 rated games (of which 97 are correspondence, and 35 classical): https://drive.google.com/file/d/1DTuWKZOZLBbCDQxqTQzJ7p3QNB8AMMW5/view?usp=sharing

My chess insights analyses only 96 games (62 correspondence, 34 classical). https://drive.google.com/file/d/12LVrzQksByUbF-0PW6eQp1grTMyU5ED9/view?usp=sharing

closed time in 3 days

lechaz79

issue commentornicar/lila

Lacking games in "Chess insights"

It may be because the other games don't have computer analysis. Please let me know if that's not the case.

lechaz79

comment created time in 3 days

issue closedornicar/lila

Chess Insights VS Lichess API : Lacking games on Italian Opening (C50)

<!-- Thank you for reporting an issue.

GitHub issues are meant for tracking enhancements and bugs, not general support.

When looking for support, please first search for your question in these venues:

  • Lichess.org wiki: https://github.com/ornicar/lila/wiki
  • Open or closed issues: https://github.com/ornicar/lila/issues

If you didn't find an answer in one of the official resources above, you can search these unofficial resources:

  • Questions tagged 'lichess' on StackOverflow
  • Lichess.org discord channel: https://discord.gg/pw6Efvk
  • #lichess channel on chat.freenode.net

HOW TO REPORT A BUG:

  • Give the exact URL where the bug happened
  • List the exact steps to reproduce the bug
  • Describe what you expected to happen
  • Describe what happened instead
  • List your operating system version and browser version
  • Add one or more screenshots if possible

Enter your issue details below this comment. --> Hello,

I discovered Chess Insights last week. Congratulations for this awesome feature ! At the same time, I also made some analytics with Lichess API (Export games of a user - https://lichess.org/api/games/user/{username}) and Pandas. I found some differences between my analytics and Chess Insights.

For exemple, Chess Insights doesn't find my games on Italian Opening (C50) with Black. https://lichess.org/insights/remlebarbare/ratingDiff/opening/opening:C50/color:black image

My analytics found 7 games (all rated and played with Black in Blitz) : https://lichess.org/ZHmujiv4 https://lichess.org/geqYBymE https://lichess.org/mvxlu0aX https://lichess.org/mvauiP8R https://lichess.org/hF8rHnkb https://lichess.org/gfZ7B3g8 https://lichess.org/Ell3ARLH

Here you can find my games and stats on openings in CSV format games_and_stats_remlebarbare.zip

I found a similar issue about lacking games : https://github.com/ornicar/lila/issues/5704

Regards, Rémi

closed time in 3 days

remi-picard

issue commentornicar/lila

Chess Insights VS Lichess API : Lacking games on Italian Opening (C50)

Looks like it may be becasuse those games don't have computer analysis (with the exception of https://lichess.org/Ell3ARLH, but it may not have been analysed at the time).

remi-picard

comment created time in 3 days

issue closedornicar/lila

Correspondence side lines improvement

I recently discovered correspondence games and I like them a lot, because they allow me to think and analyze deeper.

Sometimes one plays certain moves because one either likes the resulting position more or because one feels like attacking or not. But as a human you are wrong from time to time (or most of the time :D). It would be really nice to have the possibility to track those side lines as you can do at the normal analysis board (save them, comment them, use arrows etc.). So one would get a much richer game and can analyze if ones feelings were right or not.

closed time in 3 days

6heads

issue commentornicar/lila

Correspondence side lines improvement

Same request as #3711.

6heads

comment created time in 3 days

issue commentornicar/lila

When making a move on a corresponence game, confirmation move sound suddenly cuts down

There have been significant changes to the sound system. Is this still happening?

Pablo-No

comment created time in 3 days

push eventornicar/lila

Niklas Fiekas

commit sha 22f4a288e5d30a887161f7736eaf78410326dbe5

toggle mousedown messes with uac focus (fixes #7482)

view details

push time in 3 days

issue closedornicar/lila

Bug when searching in a tournament with the magnifying glass two times

The first time you click on the magnifying glass it's ok but on a second search the focus is no more on the text area (of the search).

closed time in 3 days

Vinvin20

push eventniklasf/syzygy-tables.info

Niklas Fiekas

commit sha f5b4e57c1e4ad79e1127a3a68f67ef7232913741

minor tweaks/fixes

view details

push time in 3 days

push eventniklasf/syzygy-tables.info

Niklas Fiekas

commit sha f6b7c696091d37cd07c709521c989c68b197a338

comment flake8 config

view details

Niklas Fiekas

commit sha 2bc01da539cb1f40adc5a9661d30b9b0f39bb88f

delete some font types

view details

Niklas Fiekas

commit sha 4745b6ef6a69490277750b98e993d14401f45594

port metrics page to tinyhtml

view details

push time in 3 days

push eventniklasf/syzygy-tables.info

Niklas Fiekas

commit sha 9a25f32fc780160892aa71402bb49f9b995d400f

reorganize python package

view details

Niklas Fiekas

commit sha a5aabc96f45c4d081c640a834d767c8af6d8be1d

remove htmlmin dependency

view details

Niklas Fiekas

commit sha 98cdb75e657f69d800e2d18a67aab3c4ededa47b

install tinyhtml

view details

Niklas Fiekas

commit sha 01016b5b6386859f34321dbe77d5b1adcf334226

add some types, found two bugs

view details

Niklas Fiekas

commit sha cc646a9c733277904c888924deb8713f58bfb5b1

port layout to tinyhtml

view details

Niklas Fiekas

commit sha b33800394401653621a1e1d8ab5aa72adb6b77ea

complete layout

view details

Niklas Fiekas

commit sha 0c06c654c808bf6d2e9da44349d80bdcd97a778a

port legal to tinyhtml

view details

push time in 3 days

push eventlichess-org/api

ornicar

commit sha 689b12c16bc7f7c143c2cdde6e5a6aa81e7ff0c2

Deploy to GitHub Pages

view details

push time in 3 days

release niklasf/python-chess

v1.2.0

released time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 8b7ed230711e3020422b2ab5c3b6fe2c870630fe

Prepare 1.2.0

view details

push time in 4 days

created tagniklasf/python-chess

tagv1.2.0

A pure Python chess library with move generation and validation, PGN parsing and writing, Polyglot opening book reading, Gaviota tablebase probing, Syzygy tablebase probing and UCI/XBoard engine communication

created time in 4 days

issue closedniklasf/python-chess

websockets/eventlet not working together with chess engine on Heroku

Hi,

When running Stockfish engine on Heroku, I get this error. Locally everything works fine. Thanks!

import chess
import chess.engine
from flask import Flask
import os
import stat
import sys

app = Flask(__name__)

@app.route('/')
def index():
    board = chess.Board()
    if sys.platform == "linux":
        os.chmod("./stockfish_20011801_x64", stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
        engine = chess.engine.SimpleEngine.popen_uci("./stockfish_20011801_x64")
    else:
        engine = chess.engine.SimpleEngine.popen_uci("./stockfish_20011801_x64.exe")
    result = engine.play(board, chess.engine.Limit(time=3))
    board.push(result.move)
    return board.fen()

[2020-09-08 08:58:53,494] ERROR in app: Exception on / [GET] 2020-09-08T08:58:53.494843+00:00 app[web.1]: Traceback (most recent call last): 2020-09-08T08:58:53.494845+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app 2020-09-08T08:58:53.494846+00:00 app[web.1]: response = self.full_dispatch_request() 2020-09-08T08:58:53.494847+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request 2020-09-08T08:58:53.494848+00:00 app[web.1]: rv = self.handle_user_exception(e) 2020-09-08T08:58:53.494848+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception 2020-09-08T08:58:53.494849+00:00 app[web.1]: reraise(exc_type, exc_value, tb) 2020-09-08T08:58:53.494849+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise 2020-09-08T08:58:53.494850+00:00 app[web.1]: raise value 2020-09-08T08:58:53.494850+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request 2020-09-08T08:58:53.494851+00:00 app[web.1]: rv = self.dispatch_request() 2020-09-08T08:58:53.494851+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request 2020-09-08T08:58:53.494852+00:00 app[web.1]: return self.view_functionsrule.endpoint 2020-09-08T08:58:53.494852+00:00 app[web.1]: File "/app/app.py", line 14, in index 2020-09-08T08:58:53.494853+00:00 app[web.1]: result = engine.play(board, chess.engine.Limit(time=0.1)) 2020-09-08T08:58:53.494853+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/chess/engine.py", line 2386, in play 2020-09-08T08:58:53.494854+00:00 app[web.1]: return future.result() 2020-09-08T08:58:53.494855+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/concurrent/futures/_base.py", line 439, in result 2020-09-08T08:58:53.494855+00:00 app[web.1]: return self.__get_result() 2020-09-08T08:58:53.494856+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result 2020-09-08T08:58:53.494856+00:00 app[web.1]: raise self._exception 2020-09-08T08:58:53.494856+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/asyncio/tasks.py", line 483, in wait_for 2020-09-08T08:58:53.494857+00:00 app[web.1]: return fut.result() 2020-09-08T08:58:53.494857+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/chess/engine.py", line 1316, in play 2020-09-08T08:58:53.494857+00:00 app[web.1]: return await self.communicate(UciPlayCommand) 2020-09-08T08:58:53.494857+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/chess/engine.py", line 768, in communicate 2020-09-08T08:58:53.494858+00:00 app[web.1]: return await command.result 2020-09-08T08:58:53.494858+00:00 app[web.1]: chess.engine.EngineTerminatedError: engine process died unexpectedly (exit code: 0) 2020-09-08T08:58:53.496052+00:00 app[web.1]: 10.35.251.250 - - [08/Sep/2020:08:58:53 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"

closed time in 4 days

StevenDalderop

issue commentniklasf/python-chess

websockets/eventlet not working together with chess engine on Heroku

Unfortunately the patches appear to be too intrusive (and monkey patching the standard library is pretty questionable), so I don't see a way forward.

Perhaps the PidfdChildWatcher that's automatically used from Python 3.9+ (if run on Linux 5.3+) will work. But even if it does, there's no good way to make it available on previous versions.

StevenDalderop

comment created time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha a07d343b0613c1b745eb074f49d5b35a4bc65f6a

Fix rst in CHANGELOG (at least in the new one)

view details

Niklas Fiekas

commit sha bbf87dbf09affcccb341762266eb140abe15628a

Add deprecation notice for PovWdl tuple like behavior

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha dc529b2c640b17c1b163582d81bd4e17cf6ae6cc

Clarify change around [%eval #0]

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 6c20669b0c2363115475a183a228152ff4ce0e77

Explicit type annotations for reamining class vars

view details

push time in 4 days

push eventlichess-org/api

niklasf

commit sha 050ccdbba89452b890300bf183aba1cb07e93121

Deploy to GitHub Pages

view details

push time in 4 days

issue commentlichess-org/api

Replace string in example by int

Indeed, thanks. Checked the source and it appears to be an int.

tmmlaarhoven

comment created time in 4 days

push eventlichess-org/api

Niklas Fiekas

commit sha 2c2bfc716852d6c1b8818a140255b2c3d48c6625

puzzle round rating is int (fixes #64)

view details

push time in 4 days

issue closedlichess-org/api

Replace string in example by int

In https://github.com/lichess-org/api/blob/master/doc/specs/lichess-api.yaml on line 3876 (context given in case line numbers change):

PuzzleRoundJson:
  example: {
    "id": 70232,
    "date": 1514505150384,
    "rating": "1982",
    "ratingDiff": 5,
    "puzzleRating": 1877
  }

The "rating" should return an int (and I think it does), but the example suggests it returns the rating as a string.

closed time in 4 days

tmmlaarhoven

issue commentlichess-org/api

Node.js error at running index.js : app.get('/callback', async (req, res) => {

You're probably running a very old nodejs. Updated the example to specify a minimum version.

arioboo

comment created time in 4 days

push eventlichess-org/api

niklasf

commit sha ab65f8c75e1af9866dd2a4f63524e4bc16c1c17b

Deploy to GitHub Pages

view details

push time in 4 days

push eventlichess-org/api

Niklas Fiekas

commit sha 6e6159b7037f934659b37b31d66236c438672dfb

specify minimum nodejs version for example (fixes #62)

view details

push time in 4 days

issue closedlichess-org/api

Node.js error at running index.js : app.get('/callback', async (req, res) => {

Hello, I have configured my lichess account to have an oauth app and a personal API token. When I was following the instructions of the oauth_app example, the following happened when I ran "node index.js"

app.get('/callback', async (req, res) => {
                           ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:387:7)
    at startup (bootstrap_node.js:153:9)

I have no idea of how to handle this error, and I'm new to nodejs. A better documentation or a quick help would be needed.

closed time in 4 days

arioboo

push eventlichess-org/api

ornicar

commit sha a29a6ab67d5350ddd2200e4209e6e13d8043b670

Deploy to GitHub Pages

view details

push time in 4 days

issue closedlichess-org/api

Swiss tournaments results

Make Swiss tournaments results (score + tie-breaks for each player) available, to be able to easily process results without having to parse the .trf file and re-calculate the Sonneborn–Berger tie-break score

closed time in 4 days

eduherminio

issue commentlichess-org/api

Swiss tournaments results

via ornicar/lila@18c882cc7a053b740ac33569b19f48904b34594c, see ornicar/lila#7448 and https://lichess.org/api#operation/resultsBySwiss

eduherminio

comment created time in 4 days

issue closedlichess-org/api

Trying to stream board using serverless architecture but CORS

Hi, I'm using Lambda functions to perform OAuth2 authentication and everything works fine until I want to stream the board by calling the /api/board/game/stream/{gameId} endpoint. Since I receive a NDJSON ReadableStream response which leaves the connection open I can't make this work from a serverless function since it times out after some time and closes the connection.

So my solution to keep this architecture was to break a bit the security and allow the browser to request the access token (which is stored in a HTTP only, same site cookie) and have the browser open this connection client-side. Problem is that I receive a cors type fetch response and I'm unable to receive any data at all.

Captura de Pantalla 2020-07-03 a la(s) 13 37 31

I know that by avoiding the whole serverless idea and deploying a full API on Heroku as opposed to Lambda functions would definitely make this work, but is there a way to have this working under the serverless paradigm?

closed time in 4 days

lropero

issue closedlichess-org/api

update dependencies of examples

Especially simple-oauth2, which depends on a vulnerable version of cryptiles.

closed time in 4 days

niklasf

issue commentlichess-org/api

update dependencies of examples

via a9c00a270d3ecf31da6929f90da98f20ffb29559

niklasf

comment created time in 4 days

push eventlichess-org/api

ornicar

commit sha d6e26a4fb13621b8e449e14eef6ac39fe2829c34

Deploy to GitHub Pages

view details

push time in 4 days

push eventlichess-org/api

ornicar

commit sha 4e747342cd4785c8d26bc9a37d5d0d1be66c681d

Deploy to GitHub Pages

view details

push time in 4 days

create barnchniklasf/lichess-puzzler

branch : suggestions

created branch time in 4 days

issue commentniklasf/python-chess

Ideas for breaking changes

  • Remove chess.engine.PovWdl bc for Tuple[int, int, int].
niklasf

comment created time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 049f66786f1afde64d579efa67a67173f634d4c8

Prepare changelog

view details

push time in 4 days

issue closedniklasf/python-chess

Question - Adding a variation

Hi Niklas, I have got a question again. Currently, I'm trying to add a variation using this code:

def get_eval(fen):
    """
    Gets the current evaluation of the position
    """
    board = chess.Board(fen)
    engine = chess.engine.SimpleEngine.popen_uci(engfile)
    info = engine.analyse(board, chess.engine.Limit(0.1))
    engine.quit()
    return int(str(info['score'])) / 100

def get_best_var(fen, uci=False):
    """
    Gets the best variation from uci in position
    """
    board = chess.Board(fen)
    engine = chess.engine.SimpleEngine.popen_uci(engfile)
    result = engine.analyse(board, chess.engine.Limit(time=0.1))
    engine.quit()
    if uci:
        return result['pv']
    else:
        return board.variation_san(result['pv'])

prev_eva = 0.00
for move in pgn.mainline_moves():
    board.push(move)
    eva = get_eval(board.fen())
    if 0.15 < abs(prev_eva - eva) <= 0.3:  # Good move, but not the best
        board.pop()
        pgn.add_line(get_best_var(board.fen(), uci=True),
                             starting_comment='Good move, but better was: ',
                             comment=str(get_eval(board.fen())))                             
        board.push(move)
    prev_eva = eva

So that is my code until now(there are more than just good move, but it would have been a lot of code to add), but when the code runs, it only adds variations to move number 1 and sometimes the moves come as exe6, dxd4 and so forth. I think it might be happening while converting moves from UCI to SAN but I don't know. Could you please help me solve this problem?

Thanks again, Aryan

closed time in 4 days

CoderAryanAnand

issue commentniklasf/python-chess

Question - Adding a variation

Just not abs(). Instead look at the signed difference. Btw. you might be interested in this feature, that's coming in the next release: https://python-chess.readthedocs.io/en/latest/engine.html#chess.engine.Score.wdl

CoderAryanAnand

comment created time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha f68f7b330265402747da34c8944480132baed745

Add a comma

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 778d5794f27ed7ad4cdccf9b3a8d5ec9956c8bfb

Document properties directly

view details

Niklas Fiekas

commit sha cae9f6b342f429442073dbd20b1ec8ec23da480d

Port remaining py:attribute docs to fields

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 82e503130aa5a6849cb3b847b470ca87e4a32284

Do not use try-else for Literal imports

view details

Niklas Fiekas

commit sha 069f0f03fbe6f84b743d5c170a9c3cbe4917c5c6

Fix typo: thits -> tbhits

view details

Niklas Fiekas

commit sha 1393e6efab59304fbbb8b8690e9e1444b1093933

Clarify info["multipv"]

view details

Niklas Fiekas

commit sha 9ab3a9ea5786c9af49390b0bd0c003c613764661

Port core py:attribute to field docs

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 85e0a4c76acb4fa58ed398822315656aa297e222

Add PovWdl and Wdl

view details

Niklas Fiekas

commit sha 1c0e36897e25bb7dbf263376ab3b1946475699de

Integrate Wdl with InfoDict

view details

Niklas Fiekas

commit sha 5f5291e3f29eae6a4c80f4bf6ae925d57ba1cab7

Draft Score to Wdl conversion

view details

Niklas Fiekas

commit sha 8fdd22d4833d051b98e17f550c26e696b2b81fe7

Wdl fixes and consistency checks

view details

Niklas Fiekas

commit sha 43afa7679b5495bf7510e78f0c015cd5a8981303

Document Wdl

view details

Niklas Fiekas

commit sha 869abdaa528226eced14d81aa6ae9d38860c7e53

Implement Wdl.__bool__

view details

Niklas Fiekas

commit sha 8904795d1525b2c38b7b5def3441ccef3cdbbaad

Merge pull request #675 from niklasf/pov-wdl Implement chess.engine.PovWdl, chess.engine.Wdl and winning chance heuristics

view details

push time in 4 days

issue closedniklasf/python-chess

Feature idea: chess.engine.Wdl

A typed wrapper around win/draw/loss info.

Useful operations:

  • Flipping
  • Expectation value
  • Conversion from classical score based on winning chance model, like the one in Stockfish 12 (also see https://github.com/niklasf/python-chess/issues/668#issuecomment-708497314)

Unfortunately info["wdl"] is a Tuple[int, int, int] with permille values, where float probabilities would be more natural. Maybe implement Wdl and leave PovWdl for python-chess 2.0?

closed time in 4 days

niklasf

push eventniklasf/python-chess

Niklas Fiekas

commit sha 43afa7679b5495bf7510e78f0c015cd5a8981303

Document Wdl

view details

Niklas Fiekas

commit sha 869abdaa528226eced14d81aa6ae9d38860c7e53

Implement Wdl.__bool__

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 85e0a4c76acb4fa58ed398822315656aa297e222

Add PovWdl and Wdl

view details

Niklas Fiekas

commit sha 1c0e36897e25bb7dbf263376ab3b1946475699de

Integrate Wdl with InfoDict

view details

Niklas Fiekas

commit sha 5f5291e3f29eae6a4c80f4bf6ae925d57ba1cab7

Draft Score to Wdl conversion

view details

Niklas Fiekas

commit sha 8fdd22d4833d051b98e17f550c26e696b2b81fe7

Wdl fixes and consistency checks

view details

push time in 4 days

delete branch niklasf/python-chess

delete branch : typing

delete time in 4 days

delete branch niklasf/python-chess

delete branch : python-350

delete time in 4 days

delete branch niklasf/python-chess

delete branch : debug-coordinates

delete time in 4 days

create barnchniklasf/python-chess

branch : pov-wdl

created branch time in 4 days

issue closedniklasf/python-chess

Test Python 3.9 in CI

Either on Travis, or move to GitHub actions.

closed time in 4 days

niklasf

issue closedniklasf/python-chess

a question from a beginner

Hi. Im doing a chess board (almost finished) following a "sketch tutorial". The idea of the tutorial is that you learn to program, etc. in the middle (at least a little). Is a physicall chess board that run stockfish.

But, i want to extend the project and make it possible to play on lichess. I read the "python-lichess" ans says "Easy to integrate with python-chess". So, i already use in "my" project a library called Chessboard (version 2.0.5) from John Eriksson (wmjoers).

I will like to use your library to make the integration with python lichess more "easy" for me.

But.... (sorry my ignorance) on chessboard i have some function self explanatory. But, you have some readme where you comment for what are your function, etc.? (probably yes... can you tell me the link)?

Thanks and sorry, but im a monkey trying to make his chess board.

p.s.: for example i have this: `This is a very short description of the public methods of ChessBoard.

chessboard = ChessBoard() Creates a new instance of the ChessBoard component.

chessboard.resetBoard() Resets the chess board and all states.

chessboard.setFEN(fen) Sets the board and states accoring from a Forsyth-Edwards Notation string. Ex. 'rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2'

chessboard.getFEN() Returns the current state as Forsyth-Edwards Notation string.

chessboard.isCheck() Returns True if the current players king is checked.

chessboard.isGameOver() Returns True if the game is over by either checkmate or draw. Use getGameResult() to find out why game is over.

chessboard.getGameResult() Returns the reason for game over. If game is not over this method returns None. It can be the following reasons: ChessBoard.WHITE_WIN ChessBoard.BLACK_WIN ChessBoard.STALEMATE ChessBoard.FIFTY_MOVES_RULE ChessBoard.THREE_REPETITION_RULE

chessboard.getBoard() Returns a copy of the current board layout. Uppercase letters for white, lovercase for black. K=King, Q=Queen, B=Bishop, N=Night, R=Rook, P=Pawn. Empty squares are marked with a period (.) Exmaple return value (the initial board):

    [['r','n','b','q','k','b','n','r'],       
     ['p','p','p','p','p','p','p','p'],       
     ['.','.','.','.','.','.','.','.'],       
     ['.','.','.','.','.','.','.','.'],       
     ['.','.','.','.','.','.','.','.'],       
     ['.','.','.','.','.','.','.','.'],       
     ['P','P','P','P','P','P','P','P'],       
     ['R','N','B','Q','K','B','N','R']]

chessboard.getTurn()
Returns the current player. Return value can be: ChessBoard.WHITE ChessBoard.BLACK

chessboard.getValidMoves(location) Returns a list of valid moves. (ex [ (3,4),(3,5),(3,6) ... ] ) If there isn't a valid piece on that location or the piece on the selected location hasn't got any valid moves an empty list is returned. The location argument must be a tuple containing an x,y value Ex. (3,3)

Example (with a fresh board):
    chessboard.getValidMoves((4,6)) returns [(4,5),(4,4)]

chessboard.addMove(fromPos,toPos) Tries to move the piece located on fromPos to toPos. Returns True if that was a valid move. The position arguments must be tuples containing x,y value Ex. (4,6) If this method returns False you can use the getReason method to determin why.

Right now ChessBoard only use its own internal coordinates in the comunication with the client. 
The coordinates starts at (0,0) in the upper left corner. Ex: (0,0) = A8, (7,7) = H1. 

Example:
    The popular opening e2-e4 is done by calling chessboard.addMove((4,6),(4,4))        

chessboard.addTextMove(move) Adds a move using several different standards of the Algebraic chess notation. AN Examples: 'e2e4' 'f1d1' 'd7-d8' 'g1-f3' SAN Examples: 'e4' 'Rfxd1' 'd8=Q' 'Nxf3+' LAN Examples: 'Pe2e4' 'Rf1xd1' 'Pd7d8=Q' 'Ng1xf3+'

chessboard.getReason() Returns the reason to why addMove() returned False. Return values can be: ChessBoard.INVALID_MOVE ChessBoard.INVALID_COLOR ChessBoard.INVALID_FROM_LOCATION ChessBoard.INVALID_TO_LOCATION ChessBoard.MUST_SET_PROMOTION (use setPormotion() and call addMove() again) ChessBoard.GAME_IS_OVER ChessBoard.AMBIGUOUS_MOVE (a given textmove could be done by two different pieces)

chessboard.setPromotion(promotion) Tell the chessboard how to promote a pawn. Use this when addMove returns MUST_SET_PROMOTION. The promotion value is stored until another promotion value is set.

promotion can be: 
    ChessBoard.QUEEN
    ChessBoard.ROOK
    ChessBoard.KNIGHT
    ChessBoard.BISHOP
    
Use setPromotion(0) to clear the promotion value.

chessboard.getPromotion() Return the current promotion value.

result can be: 
    ChessBoard.QUEEN
    ChessBoard.ROOK
    ChessBoard.KNIGHT
    ChessBoard.BISHOP
or 0 (zero) if no promotion value is set.

chessboard.getLastMove: Returns a tupple containing two tupples describing the move just made using the internal coordinates. In the format ((from_x,from_y),(to_x,to_y)) Ex. ((4,6),(4,4)) Returns None if no moves has been made.

chessboard.getAllTextMoves(format) Returns a list of all moves done so far in Algebraic chess notation. Returns None if no moves has been made.

format can be:
    ChessBoard.AN
    ChessBoard.SAN (default)
    ChessBoard.AN

chessboard.getLastTextMove(format) Returns the latest move as Algebraic chess notation. Returns None if no moves has been made.

format can be:
    ChessBoard.AN
    ChessBoard.SAN (default)
    ChessBoard.AN

chessboard.getLastMoveType() Returns a value that indicates if the last move was a "special move". Returns -1 if no move has been done. Return value can be: chessboard.NORMAL_MOVE chessboard.EP_MOVE (Pawn is moved two steps and is valid for en passant strike) chessboard.EP_CAPTURE_MOVE (A pawn has captured another pawn by using the en passant rule) chessboard.PROMOTION_MOVE (A pawn has been promoted. Use getPromotion() to see the promotion piece.) chessboard.KING_CASTLE_MOVE (Castling on the king side.) chessboard.QUEEN_CASTLE_MOVE (Castling on the queen side.)

chessboard.getMoveCount()
Returns the number of halfmoves in the stack. Zero (0) means no moves has been made.

chessboard.getCurrentMove() Returns the current halfmove number. Zero (0) means before first move.

chessboard.gotoMove(move) Goto the specified halfmove. Zero (0) is before the first move. Returns False if move is out of range.

chessboard.gotoFirst() Goto the state before the first known move.

chessboard.gotoLast() Goto after the last knwon move.

chessboard.undo() Undo the last move. Can be used to step back until the initial board setup. Returns True or False if no more moves can be undone.

chessboard.redo() If you used the undo method to step backwards you can use this method to step forward until the last move i reached. Returns True or False if no more moves can be redone.

chessboard.printBoard() Prints the current board layout to standard output. `

closed time in 4 days

9acca9

issue commentniklasf/python-chess

a question from a beginner

Hi, yes. The documentation can be found at https://python-chess.readthedocs.io/en/latest/.

9acca9

comment created time in 4 days

issue closedornicar/lila

Disappearing ui elements, learning from mistakes mode

Some ui elements seem to disappear during analyzing matches and learning from mistakes, in example after the move has been made, the button appears for a split second and disappears again. View the included gif for more information.

Lichess website version.

My nickname: Saranskich

ezgif-2-1c546af224e6

closed time in 4 days

saranvdev

push eventniklasf/lila

Thibault Duplessis

commit sha d0fd0f5569f590868cbb7dd5f3851dda3905fe13

{master} fix report score style

view details

Thibault Duplessis

commit sha f71fc8ab20de73190071a02f2d218b9943c64e3a

tweak report score colour

view details

Thibault Duplessis

commit sha 76f8ab418df2cd078d402c3f173e6a27ab3a6d7c

report score colour, 3rd time's the charm

view details

Thibault Duplessis

commit sha 71e57c16ebf7f0a414abbafdf890634224b1b379

dark board theme WIP

view details

Niklas Fiekas

commit sha 3f1b16c2197bd7d20abd9363f3eeeba5659c7413

make gulp-cli dependency optional

view details

Niklas Fiekas

commit sha 7ce3627a9890f660c8bfb5dfca8cea1e7ca59894

stale.yml: want -> wanted label

view details

Thibault Duplessis

commit sha 3a1ea658d7888ab32f73fddd10ba35d71f26d08e

complete dark-board theme maybe

view details

Thibault Duplessis

commit sha b4f3f31dc02e14e5b68fff5029fa82f8d476f8bc

rename sheet variable in ui/dasher

view details

Thibault Duplessis

commit sha b08e8a39d260e335c08e4728122f4a9e8456a4a9

fix dark board migration script

view details

Thibault Duplessis

commit sha 445398cd7e70a0190dd0abd4821701fb458dd18f

fix enabling zen mode should not move the board - closes #7457

view details

Scala Steward

commit sha 6c5cd51a842122cb45eac9f019509c4fecf5b440

Update specs2-core to 4.10.5

view details

Thibault Duplessis

commit sha 64fecbbdb1da7a3fd832e360413a244a0ce4e862

Merge pull request #7462 from scala-steward/update/specs2-core-4.10.5 Update specs2-core to 4.10.5

view details

Scala Steward

commit sha 9f6a2a0efbbb64d9bd99edd3f6bd610e1c2a5b33

Update google-auth-library-oauth2-http to 0.22.0

view details

Thibault Duplessis

commit sha 6b0c7f23e7a0e1a38afc98fe000d1bcfc4429373

{master} tweak appeal UI

view details

Thibault Duplessis

commit sha cb8b163defbc9365418816e012ca5b3fe560b5c6

tweak arena podium cache

view details

Thibault Duplessis

commit sha b33d875d5a4bdd902660127651e202349b7d1145

delete up to 30 days of tournament history when marking a player

view details

Thibault Duplessis

commit sha 0c6e957f6c47f09fa56994984234101caf3c8932

maybe clear shield cache after a mark

view details

Thibault Duplessis

commit sha f04a6ba24718db1eba3ddd2c08a61356a9677bba

page h4 style

view details

Thibault Duplessis

commit sha ce698a9280107f6f837eb2c71b90cffd8ba16170

clear tournament winners cache after marking

view details

Thibault Duplessis

commit sha 8b23e9a2c81f4582b79e243b45a7e4ce4ee5ffbf

Merge pull request #7464 from scala-steward/update/google-auth-library-oauth2-http-0.22.0 Update google-auth-library-oauth2-http to 0.22.0

view details

push time in 4 days

push eventornicar/lila

Niklas Fiekas

commit sha efefe660581140bfd90fec5cc6c13134c4a34aa0

fix hidden mselect and tn-tg checkbox state after browser back (fixes #6760) https://stackoverflow.com/a/55927735/722291

view details

Niklas Fiekas

commit sha 209ac4f042fa4c65d6b117cacfe0a8a2e710cbf4

mselect is not only used for variants

view details

push time in 4 days

issue closedornicar/lila

Screen is a bit dark when you in analysis click on rewind button (if you entered there through a game)

<!-- Thank you for reporting an issue.

GitHub issues are meant for tracking enhancements and bugs, not general support.

When looking for support, please first search for your question in these venues:

  • Lichess.org wiki: https://github.com/ornicar/lila/wiki
  • Open or closed issues: https://github.com/ornicar/lila/issues

If you didn't find an answer in one of the official resources above, you can search these unofficial resources:

  • Questions tagged 'lichess' on StackOverflow
  • Lichess.org discord channel: https://discord.gg/pw6Efvk
  • #lichess channel on chat.freenode.net. See http://nodeirc.info/ for more information.

<!-- Enter your issue details below this comment. --> Screen is a bit dark when you in the analysis of a game (finished or not) click on rewind button until you click on the screen. Bug1 For example, If i go to lichess.org/ raGhMsa8Ndeb (without the space) , click on analysis (it doesn't matter if you clic the microscope button or the Analysis board button), wait 10 or more seconds, click on go to the last page in chrome, it happens me that. If I use dark mode I get an even darker screen: Bug: Bug2 No bug: Bug3 I cleaned cookies today and it still happens. Windows 10 OS Version 1909 (Build 18363.836) Javascript V8 8.3.110.9 Google chrome: 83.0.4103.61 (Build oficial) (64 bits) (cohort: Stable) Revisión: 94f915a8d7c408b09cc7352161ad592299f384d2-refs/branch-heads/4103@{#561}

closed time in 4 days

Pablo-No

push eventniklasf/python-chess

Niklas Fiekas

commit sha 89357e0f536bbff218cd129232cfab164fc1473a

Run mypy also on Python 3.8 CI

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha f73e290a5895326c9e4d788ada11c16be8e94c8e

Split changelog

view details

Niklas Fiekas

commit sha 43336b48ad95d103152774f76cd71fe18dfd80f1

Update tox.ini

view details

Niklas Fiekas

commit sha 205f10ae1b6fe7ba9444822faedbf1bad98f9e84

Try Python 3.9-dev on Travis CI (#671)

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 61cccb8f9512387085af20954cf04156340a31dd

Remove trailing space

view details

Niklas Fiekas

commit sha 31fa7e492eaf7e1727798e1f281e1ab28ff08b75

Revert "Try to run mypy on all Python versions" This reverts commit 277ec32970408028eef397d33336c57bf63fa817.

view details

Niklas Fiekas

commit sha b1b1fb803caecd685ceb5756f165e4ccab9e8514

Try Python 3.9 on Travis CI (#671)

view details

Niklas Fiekas

commit sha 45039e7d05f8b0267f2a3e96712bb7e8f4bd9f0a

PyPy is not tested in CI

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 157ee7ea540daf9457a3f1fa1bcddeec00036e88

Bump Sphinx

view details

Niklas Fiekas

commit sha 7fabab85bc78f7388f350d61dd13f35f2f7613ca

Try to fix Travis matrix

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 6ae12eb59fefe98228c7fdffe7fe63a1b57691af

Tweak typing.Literal bc

view details

Niklas Fiekas

commit sha 277ec32970408028eef397d33336c57bf63fa817

Try to run mypy on all Python versions

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 53e97f3d39e8b7c320d2c1eb313adf0421da331c

Tweak engine docs: Python 3.7 is now required anyway

view details

Niklas Fiekas

commit sha 83317b34a1752fb31095470b830f144c95592698

Revert "Try Python 3.9 on readthedocs" This reverts commit 9232c9c89bcda4a0c064e5826aa14dedaec4a1b0.

view details

Niklas Fiekas

commit sha facfa00dbc3ca0ee68db24342906725cc507f141

Make chess.engine.InfoDict a separate item in the documentation

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 9232c9c89bcda4a0c064e5826aa14dedaec4a1b0

Try Python 3.9 on readthedocs

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha e32f9e15e85f75c8d981d0a272a73cb3926c4856

Use GameNode.turn() in GameNode.eval() The returned PovScore is now from the point of view of the player to move. Taking the turn into account allows resolving the ambiguity of [%eval #0]. Previously None was returned in that case.

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 8460c63bde39dc2b999225d3d236b78a2c24a808

Remove PovScore.__str__()

view details

push time in 4 days

push eventniklasf/python-chess

Niklas Fiekas

commit sha 83321c7d9aabb479d3469c1d4a08d91f5d0c1936

Implement chess.pgn.GameNode.turn()

view details

Niklas Fiekas

commit sha 37ae9bf40d411729b856cc68e1d30e31a58359b9

Mainline is an iterable, not an iterator (fixes #672)

view details

Niklas Fiekas

commit sha 1e18633b1f3fb44dfa8952cce6f983cefa486c69

Implement Board.ply()

view details

Niklas Fiekas

commit sha 10bbf3ee328a31480d8011f0fb8112b1758afd20

Implement GameNode.turn() in terms of ply()

view details

Niklas Fiekas

commit sha 86b48893dea27f600d633fcea8340c67d7de7ab3

Document GameNode.ply() and GameNode.turn()

view details

push time in 5 days

issue closedniklasf/python-chess

Fix Iterable/Iterator nomenclature in chess.pgn.Mainline docs

https://www.twitch.tv/videos/776146321

closed time in 5 days

niklasf

created tagniklasf/python-tinyhtml

tagv1.0.0b1

A tiny library to safely render compact HTML5 from Python expressions.

created time in 5 days

created tagniklasf/python-tinyhtml

tagv1.0.0a1

A tiny library to safely render compact HTML5 from Python expressions.

created time in 5 days

push eventniklasf/python-tinyhtml

Niklas Fiekas

commit sha 3f3273824bb16d851db1cd44f71f324787706a39

grammar tweak

view details

Niklas Fiekas

commit sha 1e4a964e20f24f469e1e3b23aeb812dea881fcef

add docstring for module

view details

Niklas Fiekas

commit sha d649b154bda19b52f32ea2a685c23f99eef80dac

style tweak

view details

Niklas Fiekas

commit sha 08fd9a04d7efcde83819e0037cf69bf6624c15ad

add vdom tag

view details

push time in 5 days

more