Chess Tools

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy »

Laskos wrote:
Ferdy wrote:
Laskos wrote:
Ferdy wrote:You may describe here the chess tools/utilities that you need. If I have time and knowledge, I may create it. Or other programmers may also do it.
It can be FEN, EPD, and PGN processing, engine use, website scraping, data analysis and others.
Ferdi, can you write something which takes a Cutechess-Cli PGN file, and computes average time per move used by move number, after exiting the book, for each engine?

Say:
Engine: Houdini 6.03

Code: Select all

Move   Time per move
   1          1.237s
   2          1.156s
  ...           ....

  40          0.371s
  ...           ....

  90          0.121s
Maybe up to move 120 or 150 or so. The output format I would like would be:
{{1, 1.237},{2,1.156},...,{40,0.371},...{90,0.121}...}

It's easy to use it in Mathematica.
Try this, python source, exe, batch and sample pgn files are included. Try to check it first on small games, I just checked the values randomly.

https://drive.google.com/open?id=14jI67 ... QdjHO7HHC5

Code: Select all

mte.exe --help
usage: mte.exe [-h] [-i PGN] [-o OUTPUT] -p PLAYER [-m MINMOVE]

Read games from cutechess pgn output and calculate move time average by engine

optional arguments:
  -h, --help            show this help message and exit
  -i PGN, --pgn PGN     input pgn file
  -o OUTPUT, --output OUTPUT
                        csv output filename, default=out.txt
  -p PLAYER, --player PLAYER
                        player name
  -m MINMOVE, --minmove MINMOVE
                        minimum move number, default=300

MTE (Move Time Evaluator) v0.1

Code: Select all

mte.exe --pgn sf9.pgn --player "Stockfish 9" --minmove 80 --output sf9_output.txt

Code: Select all

{{1,0.00},{2,0.00},{3,0.00},{4,0.55},{5,0.32},{6,1.57},{7,1.00},{8,1.85},{9,0.28}, ...
Just notice, that

Code: Select all

--minmoves 80
is actually maxmoves.
So move 81 will not be included. I will correct that option name later, after your check.
Thanks, the "exe" works. Opening the result as "txt" in Notepad has some encoding problems, I open it in another editor. The averages are fine (I used 2 games :) ). The python file doesn't run, it asks for "chess module", which I don't have. Thank you very much!
This is a bug of notepad. So that notepad would display correctly, I can modify the output to.

Code: Select all

{{1, 0.00},{2, 0.00},{3, 0.00},...
Now with space between numbers. Would that be fine?
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy »

Ovyron wrote:
Ferdy wrote:If the scores 0.30 and 0.25 are SPOV (Side Point Of View) then the disfavorable for master would be the line d4 Nf6 line with a score of 0.25 for master.
Master is black, which wants to get the scores in black's favor (negative scores) as much as possible, so the higher the scores, the most disfavorable it gets for black, and 0.01 is more disfavorable for black than 0.00. A score of 0.25 is more favorable for to black than 0.30.
All right I get it, the scores 0.30 and 0.25 for black you mentioned are WPOV, since the root position is white to move (for slaves) the master will take the opposite side and that is black. When the root position is black to move, the master will take the white side and in this case the lower score will be followed. I will try to create this one.
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: Chess Tools

Post by Laskos »

Ferdy wrote:
Laskos wrote:
Ferdy wrote:
Laskos wrote:
Ferdy wrote:You may describe here the chess tools/utilities that you need. If I have time and knowledge, I may create it. Or other programmers may also do it.
It can be FEN, EPD, and PGN processing, engine use, website scraping, data analysis and others.
Ferdi, can you write something which takes a Cutechess-Cli PGN file, and computes average time per move used by move number, after exiting the book, for each engine?

Say:
Engine: Houdini 6.03

Code: Select all

Move   Time per move
   1          1.237s
   2          1.156s
  ...           ....

  40          0.371s
  ...           ....

  90          0.121s
Maybe up to move 120 or 150 or so. The output format I would like would be:
{{1, 1.237},{2,1.156},...,{40,0.371},...{90,0.121}...}

It's easy to use it in Mathematica.
Try this, python source, exe, batch and sample pgn files are included. Try to check it first on small games, I just checked the values randomly.

https://drive.google.com/open?id=14jI67 ... QdjHO7HHC5

Code: Select all

mte.exe --help
usage: mte.exe [-h] [-i PGN] [-o OUTPUT] -p PLAYER [-m MINMOVE]

Read games from cutechess pgn output and calculate move time average by engine

optional arguments:
  -h, --help            show this help message and exit
  -i PGN, --pgn PGN     input pgn file
  -o OUTPUT, --output OUTPUT
                        csv output filename, default=out.txt
  -p PLAYER, --player PLAYER
                        player name
  -m MINMOVE, --minmove MINMOVE
                        minimum move number, default=300

MTE (Move Time Evaluator) v0.1

Code: Select all

mte.exe --pgn sf9.pgn --player "Stockfish 9" --minmove 80 --output sf9_output.txt

Code: Select all

{{1,0.00},{2,0.00},{3,0.00},{4,0.55},{5,0.32},{6,1.57},{7,1.00},{8,1.85},{9,0.28}, ...
Just notice, that

Code: Select all

--minmoves 80
is actually maxmoves.
So move 81 will not be included. I will correct that option name later, after your check.
Thanks, the "exe" works. Opening the result as "txt" in Notepad has some encoding problems, I open it in another editor. The averages are fine (I used 2 games :) ). The python file doesn't run, it asks for "chess module", which I don't have. Thank you very much!
This is a bug of notepad. So that notepad would display correctly, I can modify the output to.

Code: Select all

{{1, 0.00},{2, 0.00},{3, 0.00},...
Now with space between numbers. Would that be fine?
Leave it as it is, I use several editors which display "txt" just fine. Then "Mathematica" has no problems. Thanks!
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy »

Laskos wrote:
Ferdy wrote:
Laskos wrote:
Ferdy wrote:
Laskos wrote:
Ferdy wrote:You may describe here the chess tools/utilities that you need. If I have time and knowledge, I may create it. Or other programmers may also do it.
It can be FEN, EPD, and PGN processing, engine use, website scraping, data analysis and others.
Ferdi, can you write something which takes a Cutechess-Cli PGN file, and computes average time per move used by move number, after exiting the book, for each engine?

Say:
Engine: Houdini 6.03

Code: Select all

Move   Time per move
   1          1.237s
   2          1.156s
  ...           ....

  40          0.371s
  ...           ....

  90          0.121s
Maybe up to move 120 or 150 or so. The output format I would like would be:
{{1, 1.237},{2,1.156},...,{40,0.371},...{90,0.121}...}

It's easy to use it in Mathematica.
Try this, python source, exe, batch and sample pgn files are included. Try to check it first on small games, I just checked the values randomly.

https://drive.google.com/open?id=14jI67 ... QdjHO7HHC5

Code: Select all

mte.exe --help
usage: mte.exe [-h] [-i PGN] [-o OUTPUT] -p PLAYER [-m MINMOVE]

Read games from cutechess pgn output and calculate move time average by engine

optional arguments:
  -h, --help            show this help message and exit
  -i PGN, --pgn PGN     input pgn file
  -o OUTPUT, --output OUTPUT
                        csv output filename, default=out.txt
  -p PLAYER, --player PLAYER
                        player name
  -m MINMOVE, --minmove MINMOVE
                        minimum move number, default=300

MTE (Move Time Evaluator) v0.1

Code: Select all

mte.exe --pgn sf9.pgn --player "Stockfish 9" --minmove 80 --output sf9_output.txt

Code: Select all

{{1,0.00},{2,0.00},{3,0.00},{4,0.55},{5,0.32},{6,1.57},{7,1.00},{8,1.85},{9,0.28}, ...
Just notice, that

Code: Select all

--minmoves 80
is actually maxmoves.
So move 81 will not be included. I will correct that option name later, after your check.
Thanks, the "exe" works. Opening the result as "txt" in Notepad has some encoding problems, I open it in another editor. The averages are fine (I used 2 games :) ). The python file doesn't run, it asks for "chess module", which I don't have. Thank you very much!
This is a bug of notepad. So that notepad would display correctly, I can modify the output to.

Code: Select all

{{1, 0.00},{2, 0.00},{3, 0.00},...
Now with space between numbers. Would that be fine?
Leave it as it is, I use several editors which display "txt" just fine. Then "Mathematica" has no problems. Thanks!
v0.2 replacing --minmove with --maxmove
https://drive.google.com/open?id=1ngHTl ... 9NL5A-hYpl
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Chess Tools

Post by Rebel »

Ferdy wrote:You may describe here the chess tools/utilities that you need. If I have time and knowledge, I may create it. Or other programmers may also do it.
It can be FEN, EPD, and PGN processing, engine use, website scraping, data analysis and others.
MEA update for WB engines :wink:
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: Chess Tools

Post by Laskos »

Ferdy wrote: v0.2 replacing --minmove with --maxmove
https://drive.google.com/open?id=1ngHTl ... 9NL5A-hYpl
Thanks, works. I will probably have to download the "chess module" for running the python file, but "exe" works just fine. Thanks!
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: Chess Tools

Post by Ovyron »

Ferdy wrote:I will try to create this one.
Sounds great! This thread seems like some kind of genie lamp for computer chess, I like a lot that we now have something like this, thank you.
Your beliefs create your reality, so be careful what you wish for.
Frank Quisinsky
Posts: 6808
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: Chess Tools

Post by Frank Quisinsky »

Hi Ferdinand,

sorry for my late answere.
Prof. work today on Sunday.

I will check all tomorrow in the evening.

Short question:
Can I added later the tool on my download area to your other nice programs?

Thanks for it!

Later ... tomorrow!

Best
Frank
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy »

Rebel wrote:
Ferdy wrote:You may describe here the chess tools/utilities that you need. If I have time and knowledge, I may create it. Or other programmers may also do it.
It can be FEN, EPD, and PGN processing, engine use, website scraping, data analysis and others.
MEA update for WB engines :wink:
Working on it :oops:
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy »

Frank Quisinsky wrote:Hi Ferdinand,

sorry for my late answere.
Prof. work today on Sunday.

I will check all tomorrow in the evening.

Short question:
Can I added later the tool on my download area to your other nice programs?

Thanks for it!

Later ... tomorrow!

Best
Frank
Yes you can add, also I will add a GPLv3 license to this tool that uses python-chess. This is a requirement when using python-chess. I will upload a new package later.