-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor and add num_nodes
and verbose
options to get_top_moves()
#16
Refactor and add num_nodes
and verbose
options to get_top_moves()
#16
Conversation
lint with black add dict type more elaborate typing type type this ignore type fixed Separete moves, info in Tuple if include_info=True lint with black add test revert; add test fix test cleanup
Add suggested cleanup Co-authored-by: kieferro <81773954+kieferro@users.noreply.github.com>
- Add support for 'num_nodes', see #14 - Add suppoert for 'verbose', see #15 - Refactor get_top_moves, remove redundant code - Add tests for new arguments - Rename 'N/s' to 'NodesPerSecond' - Add turn_perspective global option - Add get/set for self._num_nodes - Add get/set for self._turn_perspective - Todo: Refactor turn_perspective option for rest of codebase
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)stockfish/models.py
|
…ensure type checking
Wow, that's quite a PR. First of all, a big thank you for the work and the interest that you put in this project! |
It's not possible for me to request review on this PR, by the way, not sure if there's a Github setting for that. @kieferro @johndoknjas |
num_nodes
and verbose
options to get_top_moves()
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.
Okay, I am back and I looked at the changes. It looks very good overall!
We should, as you also wrote in your comment, implement the use of turn_perspective
more consistently, but that's probably beyond the scope of this PR. This is definitely a good first step and we'll continue it from there.
Ah okay, I see. But it seems that nothing can be done about that as long as you don't have write-access. But feel free to just use the draft PR feature to indicate when the PR is ready for review. |
Co-authored-by: kieferro <81773954+kieferro@users.noreply.github.com>
Co-authored-by: kieferro <81773954+kieferro@users.noreply.github.com>
Co-authored-by: kieferro <81773954+kieferro@users.noreply.github.com>
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.
LGTM
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.
The changes look good, and the tests pass for me - nice job! Thanks for your contribution.
Looks like we're all satisfied with the PR, so I've merged it into master. |
Great, thanks 🙏👍 |
Thanks 👍 Congratulations @knutole. Could you close your two PRs in the old repo (zhelyabuzhsky#115, zhelyabuzhsky#116)? This would give us a better overview. |
This PR combines and replaces #14 and #15 , with major refactor of
get_top_moves()
function. (It was much easier to combine the PR's, for obvious reasons.) I have left in quite a few comments in the refactor, to make it easier to follow. I will remove most of them once you've had a chance to look it over.get_top_moves()
, remove redundant codeturn_perspective
global option, defaults to Turn perspective. (Note: this means thatget_top_moves()
will change from returning White perspective to returning Turn perspective by default, which is not backwards compatible. See Ensure consistent evaluation perspective across the code base #18)self._turn_perspective
self._num_nodes
self._depth
asint
and add public getterget_depth()
. Fixes Improving some small things about self.depth #8set_depth()
,set_num_nodes()
,set_turn_perspective()
Stockfish
class_set_option()
. Remove redundant defaultupdate_parameters_attribute
arguments._pick()
to avoid doingcurrent_line[current_line.index("cp") + 1]
Todo: Add
turn_perspective
option for rest of codebase, see #18