zeFresk / deep-position-analysis

To analyse a chess position in depth using powerfull engines
MIT License
20 stars 1 forks source link

After finishing the analysis, the program can't save the results #2

Closed emdio closed 4 years ago

emdio commented 4 years ago

Using python3 and installed the dependencies.

Launched liike this: python3 dpa.py -p ~/soft/git/Stockfish/src/stockfish --pv=4 --depth 3 --ply-depth 5 two_knights_traxler.txt

The analysis seems to work fine, but when it tries to save the results it gives this error message:

Saving result.

Traceback (most recent call last):
  File "dpa.py", line 100, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "dpa.py", line 79, in main
    game = new_default_game(board, engine.name, args) # Create a gaame with the correct headers
  File "/home/emilio/soft/git/deep-position-analysis/files.py", line 67, in new_default_game
    stopping = (format_nodes(args.nodes,"{:1.0f}") +" nodes") if (args.nodes != None) else format_time(args.msec)
  File "/home/emilio/soft/git/deep-position-analysis/misc.py", line 33, in format_time
    if msec < 10**3: #ms
TypeError: '<' not supported between instances of 'NoneType' and 'int'
zeFresk commented 4 years ago

Hello and thank you for testing the new --ply-depth feature :)

I know this bug, hence all the tests with None in the output. However, I never add it happens with the time.

Could you tell me which engine you are using, please?

I will patch it soon but my guess is that with --ply-depth 5, if you are using a fast engine like Stockfish, the engines stop the search too fast and don't send the time spent to the program.

In this case, a good workaround would be to increase the time spent on each move on your part until I fix this.

emdio commented 4 years ago

I'm using Stockfish.

Ok, I can use any other option to stop the analysis and the program just works fine.

zeFresk commented 4 years ago

I think I fixed the bug with my last commit, could you confirm it, please?

d2ba2e7b14833133df4a8ebbd222202238839dcc

emdio commented 4 years ago

Nope, it seems to give the same error when trying to save the analysis: The command I'm using is: $ python3 dpa.py -p /home/emilio/soft/git/Stockfish/src/stockfish --pv=4 --depth 3 --ply-depth 20 two_knights_traxler.txt

`>Analysing variation 21 of 21, estimated time remaining : 0h 0m...

100% @ 1.9mnodes/s : Qf6 (-5.17)

Completed position analysis 1 of 1 from two_knights_traxler.txt in 0 hours 2 minutes 59 seconds. Saving result.

Traceback (most recent call last): File "dpa.py", line 100, in asyncio.run(main()) File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "dpa.py", line 79, in main game = new_default_game(board, engine.name, args) # Create a gaame with the correct headers File "/home/emilio/soft/git/deep-position-analysis/files.py", line 73, in new_default_game stopping = args.plydepth + " plies" TypeError: unsupported operand type(s) for +: 'int' and 'str' `

zeFresk commented 4 years ago

Ok, that one is on me, I didn't test what I needed to test... Did the latest commit solved your issue?

emdio commented 4 years ago

After the last change the program just works perfectly.