Chess Tools

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Ferdy
Posts: 4113
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy » Sun Mar 18, 2018 6:38 pm

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: 4113
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy » Sun Mar 18, 2018 6:58 pm

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: 9503
Joined: Wed Jul 26, 2006 8:21 pm
Full name: Kai Laskos

Re: Chess Tools

Post by Laskos » Sun Mar 18, 2018 6:59 pm

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: 4113
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy » Sun Mar 18, 2018 7:08 pm

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: 4788
Joined: Thu Aug 18, 2011 10:04 am

Re: Chess Tools

Post by Rebel » Sun Mar 18, 2018 7:39 pm

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: 9503
Joined: Wed Jul 26, 2006 8:21 pm
Full name: Kai Laskos

Re: Chess Tools

Post by Laskos » Sun Mar 18, 2018 7:39 pm

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: 2828
Joined: Tue Jul 03, 2007 2:30 am

Re: Chess Tools

Post by Ovyron » Sun Mar 18, 2018 10:26 pm

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.
Great spirits have always encountered violent opposition from mediocre minds.

Frank Quisinsky
Posts: 4852
Joined: Wed Nov 18, 2009 6:16 pm
Location: Trier, Germany
Contact:

Re: Chess Tools

Post by Frank Quisinsky » Sun Mar 18, 2018 10:54 pm

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
I like computer chess!

Ferdy
Posts: 4113
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy » Mon Mar 19, 2018 3:55 am

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: 4113
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Chess Tools

Post by Ferdy » Mon Mar 19, 2018 4:08 am

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.

Post Reply