by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 05 21:27
    ash-stew commented #591
  • Aug 04 19:47
    niklasf commented #591
  • Aug 04 19:45
    niklasf commented #591
  • Aug 04 19:43
    niklasf commented #591
  • Aug 04 08:41
    ash-stew commented #591
  • Aug 04 08:27

    niklasf on master

    Always accept 960 notation for … (compare)

  • Aug 04 08:22
    niklasf commented #593
  • Aug 04 07:50
    hi5games commented #593
  • Aug 04 07:47
    hi5games commented #593
  • Aug 04 07:46
    hi5games commented #593
  • Aug 04 07:34
    niklasf labeled #593
  • Aug 04 07:34
    niklasf commented #593
  • Aug 04 06:16
    hi5games opened #593
  • Aug 03 09:26
    niklasf commented #591
  • Aug 03 09:25

    niklasf on master

    Fix float and negative clock (#… (compare)

  • Aug 03 09:05

    niklasf on master

    Avoid trailing/leading spaces w… (compare)

  • Aug 03 08:35
    ash-stew commented #591
  • Aug 02 13:13
  • Aug 02 11:03
  • Aug 02 09:37
    niklasf commented #591
Wolfgang Fahl
@WolfgangFahl
Niklas Fiekas
@niklasf
thanks, i hadn't. of course pondering and infinite (stoppable) anaylsis are supported
but i guess they're already happy with the manual wrapper
tpl
@tpl
I have question about python-chess and here: https://python-chess.readthedocs.io/en/latest/engine.html#analysing-and-evaluating-a-position , there is info = engine.analyse, how get the best move from that analysis. In much older version there was possibility board.san(eval[0]), but in the latest ver. it doesn't work.
tpl
@tpl
I forgot to whom previous message I sent -> @niklasf
Niklas Fiekas
@niklasf
@tpl there is info["pv"][0] (and this issue to make for engines where that wouldn't be identical with the bestmove: niklasf/python-chess#433 )
tpl
@tpl
ok, it's ok for me. Thanks
tpl
@tpl
@niklasf one more question, but last one :) I do - board.push(engine["pv"][0]) , and after I can get fen: board.fen()) - it is ok, but how to get board san ? board.san((engine["pv"][0] dosen't work :(
Niklas Fiekas
@niklasf
san needs to be computed before push
i.e. for position.san(move), move must be a legal move in the position
Kaustubh Maske Patil
@nikochiko
@niklasf I just noticed a bug with the board.gives_check(move) added in niklasf/python-chess@112313a
When we play a move on the board and then call board.move_stack.pop(), the board's FEN does not change
Screenshot from 2020-04-22 18-52-01.png
image.png
Niklas Fiekas
@niklasf
hi @nikochiko. board.move_stack is a list that should not be modified externally. use board.pop() instead
Kaustubh Maske Patil
@nikochiko
Ahh okay, thanks for the clarification
Kaustubh Maske Patil
@nikochiko
Does the board.parse_san(...) function also work with LAN notation?
I tried it out and it seems to be the case but I want to confirm because the doc doesn't mention it
Niklas Fiekas
@niklasf
@nikochiko correct. will explicitly mention it in the documentation
Kaustubh Maske Patil
@nikochiko
:+1: great
Kaustubh Maske Patil
@nikochiko
i had a question
how do i get the last move played from a chess.Board instance?
Niklas Fiekas
@niklasf
@nikochiko board.peek()
Kaustubh Maske Patil
@nikochiko
:+1:
Simon Ilincev
@Destaq
Hi guys, I have a quick question. When I am parsing a large PGN file, I keep getting errors raised because some of the variants are unsupported, such as 3-check. I have figured out a way to bypass that and ignore them, but I still get the warnings about illegal sans and variations. How do I disable this? I don't want users of my package to see it.
Niklas Fiekas
@niklasf
it's using the logging module, so you can do import logging; logging.disable()
for more fine-grained approaches, the logger is named chess.pgn, or you can subclass chess.pgn.GameBuilder to override handle_error
Simon Ilincev
@Destaq
Super, thanks.
Kaustubh Maske Patil
@nikochiko
@niklasf is there a way to distinguish between illegal moves and ambiguous moves like perhaps a method?
I noticed that the error message in a SAN move does indicate that (one way I see now is to catch the exception and infer it from the message) but I didn't see anything direct
Niklas Fiekas
@niklasf
what's your use case for distinguishing that?
Kaustubh Maske Patil
@nikochiko
It's an interface to play blindfold chess (currently using Dialogflow), so when I receive a SAN move (or convert the speech to SAN), I want to let the user know whether the move is illegal or ambiguous to provide better feedback
I'll be making the repo public after a few additions and bug fixes
Niklas Fiekas
@niklasf
ah, interesting
not sure if SAN is the right intermediate representation for this. the parser is very lenient
for example, it ignores the capture status. but when i say "Queen captures d4", the computer hears "Queen captures e4", an opportunity to catch the mistake is lost if Qe4 is not a capture
so maybe you want to loop over board.legal_moves yourself to find matching candidates
Niklas Fiekas
@niklasf
if you want to stick to SAN regardless, the exceptions could be distinguished by type, instead of only message
2 replies
Kaustubh Maske Patil
@nikochiko

for example, it ignores the capture status. but when i say "Queen captures d4", the computer hears "Queen captures e4", an opportunity to catch the mistake is lost if Qe4 is not a capture

Right, that is something I'll have to think about. But considering all the details would make the app too complicated. For example, people may say "kills" or "takes" or "captures" to mean the same thing and sometimes they may just prefer to ignore anything like that. Same goes while giving a check. Even machine learning models wouldn't think kill, take, capture would be similar.

I think that's a trade off for a smoother experience
Kaustubh Maske Patil
@nikochiko
For now I might add an option like suggestion chip so the user can easily correct the move if it was interpreted incorrectly but surely I would work on something more concrete if it shows up more often
Kaustubh Maske Patil
@nikochiko
Wizard Chess (https://github.com/nikochiko/df-wizard-chess) built with python-chess has been made public! :tada:
Check out the Google Action at https://assistant.google.com/services/a/uid/0000003ba609b4ff
Niklas Fiekas
@niklasf
when i click "try it" in google assistant and say "Knight f3" it just does a google search. am i doing it wrong?
Kaustubh Maske Patil
@nikochiko
Did you say "talk to Wizard chess" before that?
Kaustubh Maske Patil
@nikochiko
Perhaps try doing with "Knight to F3" instead. I have added training phrases without "to" and "from" but sometimes it doesn't recognize the squares without that,
Kaustubh Maske Patil
@nikochiko
I have also added a usage guide here: https://github.com/nikochiko/df-wizard-chess#-how-do-i-play to explain the features
tpl
@tpl
Is it possible (using python chess) to find out in fen position how many pieces are undefended ?
a piece is defended if a friendly piece is attacking the square