Add egglog tutorials, change display to not inline by default, and fix bug looking up binary methods#352
Merged
Merged
Conversation
Member
Author
|
@actions-user changelog |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive egglog tutorials translated from the original Rust tutorials, changes the default display behavior to not inline leaf nodes, and fixes a bug in looking up binary methods for operations like __add__ and __mul__.
- Translates 5 egglog tutorials (basics, datalog, analysis, scheduling, extraction) from Rust to Python
- Changes default
n_inline_leavesfrom 1 to 0 for better visualization - Fixes binary method lookup by checking preserved methods before falling back to conversion logic
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| python/egglog/runtime.py | Fixes binary method lookup by moving method_name calculation and adding preserved method check |
| python/egglog/egraph.py | Changes default n_inline_leaves from 1 to 0 for display |
| python/egglog/builtins.py | Adds preserved add method to String class |
| pyproject.toml | Adds jupytext dependency and configures linting exceptions for docs |
| docs/tutorials/*.py | Adds 5 tutorial files translating egglog concepts to Python |
| docs/tutorials/init.py | Creates tutorials module |
| docs/tutorials.md | Updates tutorial index to include new tutorials |
| docs/conf.py | Configures jupytext for reading Python files as notebooks and comments out sidebar config |
| docs/changelog.md | Documents the changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #352 will not alter performanceComparing Summary
Footnotes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the tutorials from https://github.com/egraphs-good/egglog-tutorial to the Python docs. I translated each of them to Python, trying to keep the content the same, but changing a few things when they were more ergonomic in Python, like upcasting and just creating a new e-graph instead of using push/pop.
It doesn't add any of the exercises and also doesn't add Part 6 yet, which includes rust defined cost models, which aren't supported yet in Python.