Skip to content

Conversation

@saulshanabrook
Copy link
Member

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.

@saulshanabrook
Copy link
Member Author

@actions-user changelog

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_leaves from 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.

@saulshanabrook saulshanabrook merged commit b32378e into main Sep 12, 2025
4 of 5 checks passed
@saulshanabrook saulshanabrook deleted the tutorial branch September 12, 2025 23:38
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 12, 2025

CodSpeed Instrumentation Performance Report

Merging #352 will not alter performance

Comparing tutorial (984daca) with main (c8d24a3)1

Summary

✅ 7 untouched

Footnotes

  1. No successful run was found on main (984daca) during the generation of this report, so c8d24a3 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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