-
Notifications
You must be signed in to change notification settings - Fork 17
Consolidate documentation and add SessionStart hook for AI assistants #400
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| echo "🚀 Setting up egglog-python development environment..." | ||
| echo "" | ||
|
|
||
| # Check if uv is installed | ||
| if ! command -v uv &> /dev/null; then | ||
| echo "❌ Error: uv is not installed" | ||
| echo " Install with: curl -LsSf https://astral.sh/uv/install.sh | sh" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "📦 Syncing dependencies..." | ||
| if uv sync --all-extras --locked 2>&1 | grep -q "Resolved"; then | ||
| echo "✅ Dependencies synced successfully" | ||
| else | ||
| echo "✅ Dependencies already up to date" | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "🔍 Running quick validation checks..." | ||
| echo "" | ||
|
|
||
| # Run ruff check (non-blocking) | ||
| echo " → Checking code style with ruff..." | ||
| if uv run ruff check . --quiet 2>&1; then | ||
| echo " ✅ Ruff checks passed" | ||
| else | ||
| echo " ⚠️ Ruff found some issues (run 'uv run ruff check --fix .' to auto-fix)" | ||
| fi | ||
|
|
||
| # Run quick type check (non-blocking) | ||
| echo " → Type checking with mypy..." | ||
| if make mypy 2>&1 | tail -n 1 | grep -q "Success"; then | ||
| echo " ✅ Type checks passed" | ||
| else | ||
| echo " ⚠️ Type check issues found (run 'make mypy' for details)" | ||
| fi | ||
|
Comment on lines
+25
to
+39
|
||
|
|
||
| echo "" | ||
| echo "✨ Environment ready! Quick reference:" | ||
| echo "" | ||
| echo " Run tests: uv run pytest --benchmark-disable -vvv" | ||
| echo " After Rust edit: uv sync --reinstall-package egglog --all-extras" | ||
| echo " Format code: uv run ruff format ." | ||
| echo " Fix linting: uv run ruff check --fix ." | ||
| echo " Type check: make mypy" | ||
| echo "" | ||
| echo "📚 See docs/reference/contributing.md for complete development guide" | ||
| echo "" | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,17 +1,125 @@ | ||||||
| # `egglog` Python wrapper | ||||||
| # egglog Python | ||||||
|
|
||||||
| [](https://egglog-python.readthedocs.io/latest/?badge=latest) [](https://github.com/egraphs-good/egglog-python/actions/workflows/CI.yml) [](https://pypi.org/project/egglog/) [](https://pypi.org/project/egglog/) [](https://pypi.org/project/egglog/) [](https://github.com/pre-commit/pre-commit) [](https://codspeed.io/egraphs-good/egglog-python) | ||||||
|
|
||||||
| `egglog` is a Python package that provides bindings to the Rust library [`egglog`](https://github.com/egraphs-good/egglog/), | ||||||
| allowing you to use e-graphs in Python for optimization, symbolic computation, and analysis. | ||||||
| **egglog** is a Python package that provides bindings to the Rust library [`egglog`](https://github.com/egraphs-good/egglog/), allowing you to use **e-graphs** in Python for optimization, symbolic computation, and program analysis. | ||||||
|
|
||||||
| Please see the [documentation](https://egglog-python.readthedocs.io/) for more information. | ||||||
| ## What are e-graphs? | ||||||
|
|
||||||
| Come say hello [on the e-graphs Zulip](https://egraphs.zulipchat.com/#narrow/stream/375765-egglog/) or [open an issue](https://github.com/egraphs-good/egglog-python/issues/new/choose)! | ||||||
| E-graphs (equality graphs) are data structures that efficiently represent equivalence classes of expressions. They enable powerful program optimizations through **equality saturation** - a technique that finds optimal expressions by exploring many equivalent representations simultaneously. | ||||||
|
|
||||||
| ## How to cite | ||||||
| The underlying [`egglog`](https://github.com/egraphs-good/egglog) Rust library combines: | ||||||
| - **Datalog**: Efficient incremental reasoning and queries | ||||||
| - **Equality Saturation**: Term rewriting and optimization | ||||||
| - **E-graphs**: Compact representation of equivalent expressions | ||||||
|
|
||||||
| If you use **egglog-python** in academic work, please cite the paper: | ||||||
| See the paper ["Better Together: Unifying Datalog and Equality Saturation"](https://arxiv.org/abs/2304.04332) for details. | ||||||
|
|
||||||
| ## Installation | ||||||
|
|
||||||
| ```shell | ||||||
| pip install egglog | ||||||
| ``` | ||||||
|
|
||||||
| Requires Python 3.11+ and works on Linux, macOS, and Windows. | ||||||
|
|
||||||
| ## Quick Example | ||||||
|
|
||||||
| Here's how to use egglog to prove that `2 * (x + 3)` is equivalent to `6 + 2 * x` through algebraic rewriting: | ||||||
|
|
||||||
| ```{code-cell} python | ||||||
|
||||||
| ```{code-cell} python | |
| ```python |
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 grep logic for detecting successful dependency sync may not work reliably. The command checks if "Resolved" appears in the output, but
uv sync --all-extras --lockedwith--lockedflag will not resolve dependencies (it uses the lockfile). Consider checking the exit code instead or adjusting the conditional to better reflect whatuv sync --lockedactually outputs.