Skip to content
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

gaviota.py: simplify and improve code #1130

Merged
merged 3 commits into from
Jan 11, 2025
Merged

Conversation

adbar
Copy link
Contributor

@adbar adbar commented Jan 5, 2025

Hi @niklasf, I was having a look at the code to understand how endgame databases work and I saw that the Gaviota part of the code could be improved. Here is a first step:

  • Duplicate lines removed
  • Reduced code complexity (good for maintenance...)
  • Convenience functions introduced to avoid repetitions

The whole structure is the same so the PR should hopefully be easy enough to review. The tests pass and the code should also run faster.

@adbar
Copy link
Contributor Author

adbar commented Jan 5, 2025

There are apparently lines not covered by the tests that mypy was able to catch. I am open to modifying the code if it needs improvement.

chess/gaviota.py Outdated Show resolved Hide resolved
@niklasf
Copy link
Owner

niklasf commented Jan 8, 2025

Thanks, looks good! Will test offline with a larger test suite just to be sure.

@niklasf
Copy link
Owner

niklasf commented Jan 11, 2025

Found #1132 (happy if someone wants to take a look), but that's not a regression. So merging this.

@niklasf niklasf merged commit 91699cd into niklasf:master Jan 11, 2025
22 checks passed
@adbar adbar deleted the shorter_gaviota branch January 12, 2025 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants