-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change chess-python API to version 1.5 #19
Change chess-python API to version 1.5 #19
Conversation
d55fdd4
to
ef41509
Compare
Pretty cool, awesome work @karol-brejna-i , I will try to review it this weekend as I want to take a better look. |
I run this with 3 games that in the previous version produced 1 or 2 tactics (I think is not deterministic) But this code produce 0 tactics
Here are the tactics
|
I had similar experiences (the engine returned different scores between runs). I'll check the case. |
The engines produce a bit different scores so "investigate" doesn't count them as candidates for puzzles. |
It is definitely sth with the new code. Will work on that and get back to you. |
I've created a branch (from master, https://github.com/vitogit/pgn-tactics-generator/compare/master...karol-brejna-i:producing-test-context?expand=1) to produce some test data on the older version. |
Given the nondeterministic nature of engines not sure how easy/hard would be to investigate it. One idea is to use single threading when running the engine |
What I did was dump @vitogit could you take a look at the branch https://github.com/karol-brejna-i/pgn-tactics-generator/tree/producing-test-context and the following lines of ambiguous method: https://github.com/vitogit/pgn-tactics-generator/blob/master/modules/puzzle/position_list.py#L146-L147 if self.analysed_legals[0].evaluation.mate is None or self.analysed_legals[1].evaluation.cp is None:
return This method is supposed to return a boolean value. These lines return nothing. I assume that the intent was to return True here. Could you confirm? |
That line was added in your previous PR 23f543c#diff-e31f1011e582ea3d502823f13a4a64fdef87e41ed47178a0a6e497df1402a27cR146
to
or leave it as it was before |
Jeez, it looks like you are right. I broke this. Let me fix this first with a PR. |
I've created #24 to restore the condition. Going back to test this evening. |
With ambiguous fixed, the code works as expected. Regression tests that I added confirm that |
Restructure to allow running the test from the commandline; Fix broken ambiguous() condition
76482aa
to
f26bdda
Compare
I made some cleanups. Looks like this one is finally ready to be merged. |
@@ -0,0 +1,102 @@ | |||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. What do you think about adding a small section in the readme with some info about the tests, how to run them, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about a dedicated document about development aspect (how to build and publish a package -- in the future, how to test, etc.) This way we'd had a readme that is all about usage of the software, and other that is focused on development/testing. I'll start one today and share.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent I like it.
|
||
The recommended way to run the test is using `pytest`: | ||
```bash | ||
pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not in the requirements. Maybe add a line about how to install it
pip3 install -U pytest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karol-brejna-i I just left a couple of simple comments but is approved. I added you as a collaborator, so you can merge it when you want. Thank you for this awesome PR and all the improvements!
* upstream/master: Merge pull request vitogit#19; use python-chess 1.5
This PR upgrades python-chess package to the newest version and adds some basic regression tests.