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

Updating notebooks #33

Merged
merged 28 commits into from
Jul 11, 2024
Merged

Updating notebooks #33

merged 28 commits into from
Jul 11, 2024

Conversation

Xmaster6y
Copy link
Owner

@Xmaster6y Xmaster6y commented Jul 5, 2024

closes #21

Summary by Sourcery

This pull request refactors the Sampler class and its subclasses to handle multiple boards, introduces new methods for evaluating multiple puzzles, and updates the documentation and tests accordingly. Additionally, a new notebook for running models on GPU has been added.

  • New Features:
    • Added support for evaluating multiple puzzles simultaneously with the evaluate_multiple method in the Puzzle class.
    • Introduced a new board_move_generator method in the Puzzle class to yield board and move pairs.
    • Added a new notebook for running models on GPU with Colab integration.
  • Enhancements:
    • Refactored Sampler class methods to handle multiple boards instead of a single board.
    • Updated RandomSampler, ModelSampler, and PolicySampler to work with iterable boards.
    • Improved the Puzzle class to handle cases where themes or opening tags are None.
    • Enhanced the Puzzle class with a __len__ method to return the number of moves.
    • Updated the README.md to include new feature links and Colab badges.
    • Modified Sphinx configuration to adjust navigation and table of contents levels.
  • Documentation:
    • Updated documentation links in README.md to point to the latest ReadTheDocs pages.
    • Added a new notebook for evaluating models on puzzles with Colab integration.
  • Tests:
    • Added new unit tests for the Puzzle class to verify puzzle creation and usage.
    • Updated existing tests to accommodate changes in Sampler class methods.
    • Removed BatchedPolicySampler and updated tests to use PolicySampler instead.

Copy link
Contributor

sourcery-ai bot commented Jul 5, 2024

Reviewer's Guide by Sourcery

This pull request updates the README.md to provide direct links to the rendered HTML versions of the notebooks on ReadTheDocs and modifies the Sphinx configuration to improve navigation and table of contents settings. Additionally, it includes significant changes to the Sampler classes in the sampling module, updates to the Puzzle class, and enhancements to the unit tests.

File-Level Changes

Files Changes
src/lczerolens/play/sampling.py
src/lczerolens/play/puzzle.py
Refactored Sampler and Puzzle classes to handle multiple boards and added methods for evaluating multiple puzzles and computing metrics.
tests/unit/core/test_puzzle.py
tests/unit/core/test_sampling.py
Updated unit tests to handle iterable returns from methods and added new tests for evaluating multiple puzzles.
README.md
docs/source/conf.py
Updated documentation links and Sphinx configuration for improved navigation and table of contents settings.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Xmaster6y - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 5 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

docs/source/conf.py Show resolved Hide resolved
docs/source/conf.py Show resolved Hide resolved
docs/source/start.rst Outdated Show resolved Hide resolved
docs/source/start.rst Show resolved Hide resolved
docs/source/start.rst Show resolved Hide resolved
README.md Show resolved Hide resolved
docs/source/api/play/puzzle.rst Show resolved Hide resolved
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@Xmaster6y
Copy link
Owner Author

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Xmaster6y - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 12 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

src/lczerolens/play/sampling.py Outdated Show resolved Hide resolved
src/lczerolens/play/sampling.py Show resolved Hide resolved
src/lczerolens/play/puzzle.py Show resolved Hide resolved
src/lczerolens/play/puzzle.py Show resolved Hide resolved
docs/source/conf.py Show resolved Hide resolved
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"03c1f0e5da5f48c799bc4e7e2229b2f9": {
"model_module": "@jupyter-widgets/base",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider consolidating widget state definitions.

There are multiple widget state definitions that appear to be very similar. Consider consolidating these definitions to reduce redundancy and improve maintainability.

src/lczerolens/play/__init__.py Show resolved Hide resolved
src/lczerolens/play/sampling.py Outdated Show resolved Hide resolved
src/lczerolens/play/sampling.py Outdated Show resolved Hide resolved
@Xmaster6y Xmaster6y merged commit 331e1c4 into main Jul 11, 2024
2 checks passed
@Xmaster6y Xmaster6y deleted the notebooks branch July 11, 2024 22:55
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.

Add notebooks in docs
1 participant