Skip to content

Commit f6f4c72

Browse files
Merge branch 'main' into pre-commit-ci-update-config
2 parents 4cb6599 + 9ccb5b4 commit f6f4c72

18 files changed

+945
-8482
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ coverage.xml
6161

6262
# Sphinx documentation
6363
docs/_build/
64+
docs/sg_execution_times.rst
6465

6566
# PyCharm
6667
.idea/

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ _This project uses semantic versioning_
44

55
## UNRELEASED
66

7+
- Make docs builds fail on notebook execution errors and fix all doc issues [#369](https://github.com/egraphs-good/egglog-python/pull/369)
78
- Add WIP `egglog.exp.any_expr` code for tracing arbitrary expressions with Python fallback [#366](https://github.com/egraphs-good/egglog-python/pull/366)
89
- BREAKING: Remove support for Python 3.11 now that pyo3 has dropped support.
910
- Allow mutating methods to update their underlying expression via `Expr.__replace_expr__`, and ensure default rewrites return the mutated receiver when using `mutates_self` or `mutates_first_arg`.

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"**.ipynb_checkpoints",
116116
"auto_examples/*.ipynb",
117117
# "auto_examples/*.md5",
118+
"conf.py", # Sphinx config file, not a notebook
118119
]
119120
nitpicky = True
120121

@@ -164,8 +165,7 @@
164165
# nb_execution_cache_path = ''
165166

166167
# Exclude (POSIX) glob patterns for notebooks
167-
# nb_execution_excludepatterns = ()
168-
168+
# Temporarily exclude notebooks with unrelated errors (not @egraph.class_ issues)
169169
# Execution timeout (seconds)
170170
nb_execution_timeout = 60 * 10
171171

@@ -176,7 +176,7 @@
176176
# nb_execution_allow_errors = False
177177

178178
# Raise an exception on failed execution, rather than emitting a warning
179-
nb_execution_raise_on_error = False
179+
nb_execution_raise_on_error = True
180180

181181
# Print traceback to stderr on execution error
182182
nb_execution_show_tb = True

docs/explanation/2023_07_presentation.ipynb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@
465465
"source": [
466466
"## Open Source Data Science Ecosystem in Python\n",
467467
"\n",
468-
"> <small>The term “ecosystem” is often used to describe the modern open-source scientific software. In biology, the term “ecosystem” is defined as a biological community of interacting organisms and their physical environment. Modern open-source scientific software development occurs in a similarly interconnected and interoperable fashion.</small>\n",
468+
"> <small>The term \u201cecosystem\u201d is often used to describe the modern open-source scientific software. In biology, the term \u201cecosystem\u201d is defined as a biological community of interacting organisms and their physical environment. Modern open-source scientific software development occurs in a similarly interconnected and interoperable fashion.</small>\n",
469469
"\n",
470470
"<small>from [Jupyter Meets the Earth: Ecosystem](https://jupytearth.org/jupyter-resources/introduction/ecosystem.html)</small>\n",
471471
"\n",
@@ -984,7 +984,6 @@
984984
"egraph = EGraph()\n",
985985
"\n",
986986
"\n",
987-
"@egraph.class_\n",
988987
"class Structure(Expr): ...\n",
989988
"\n",
990989
"\n",
@@ -993,7 +992,7 @@
993992
"c = egraph.constant(\"c\", Structure)\n",
994993
"\n",
995994
"\n",
996-
"@egraph.function\n",
995+
"@function\n",
997996
"def operation(l: Structure, r: Structure) -> Structure: ...\n",
998997
"\n",
999998
"\n",
@@ -3057,7 +3056,6 @@
30573056
"egraph = EGraph()\n",
30583057
"\n",
30593058
"\n",
3060-
"@egraph.class_\n",
30613059
"class Num(Expr):\n",
30623060
" @classmethod\n",
30633061
" def var(cls, name: StringLike) -> Num: ...\n",
@@ -5332,7 +5330,6 @@
53325330
"egraph = EGraph()\n",
53335331
"\n",
53345332
"\n",
5335-
"@egraph.class_\n",
53365333
"class Bool(Expr):\n",
53375334
" def to_py(self) -> PyObject: ...\n",
53385335
"\n",
@@ -5888,14 +5885,13 @@
58885885
"egraph = EGraph()\n",
58895886
"\n",
58905887
"\n",
5891-
"@egraph.class_\n",
58925888
"class Num(Expr):\n",
58935889
" def __init__(self, i: i64Like) -> None: ...\n",
58945890
"\n",
58955891
" def __add__(self, other: Num) -> Num: ...\n",
58965892
"\n",
58975893
"\n",
5898-
"@egraph.function\n",
5894+
"@function\n",
58995895
"def fib(x: i64Like) -> Num: ...\n",
59005896
"\n",
59015897
"\n",
@@ -12099,4 +12095,4 @@
1209912095
},
1210012096
"nbformat": 4,
1210112097
"nbformat_minor": 5
12102-
}
12098+
}

docs/explanation/2023_11_09_portland_state.ipynb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
"source": [
171171
"_What is built on top of this?_\n",
172172
"\n",
173-
"> The term “ecosystem” is often used to describe the modern open-source scientific software. In biology, the term “ecosystem” is defined as a biological community of interacting organisms and their physical environment. Modern open-source scientific software development occurs in a similarly interconnected and interoperable fashion.\n",
173+
"> The term \u201cecosystem\u201d is often used to describe the modern open-source scientific software. In biology, the term \u201cecosystem\u201d is defined as a biological community of interacting organisms and their physical environment. Modern open-source scientific software development occurs in a similarly interconnected and interoperable fashion.\n",
174174
"\n",
175175
"[Jupyter Meets the Earth: Ecosystem](https://jupytearth.org/jupyter-resources/introduction/ecosystem.html)\n"
176176
]
@@ -313,7 +313,7 @@
313313
"source": [
314314
"## How do we manage the new complexity?\n",
315315
"\n",
316-
"Integrated frameworks funded by companies with 💸?\n",
316+
"Integrated frameworks funded by companies with \ud83d\udcb8?\n",
317317
"\n",
318318
"<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Google_JAX_logo.svg/1024px-Google_JAX_logo.svg.png\" width=\"200px\" align=\"center\"> <img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/PyTorch_logo_black.svg/2560px-PyTorch_logo_black.svg.png\" width=\"200px\" align=\"center\"> <img src=\"https://miro.medium.com/v2/resize:fit:1400/0*kXleHB9RbdRW26Uy.png\" width=\"200px\" align=\"center\">\n"
319319
]
@@ -465,14 +465,13 @@
465465
"\n",
466466
"\n",
467467
"# 1. Describe domain with types & functions\n",
468-
"@egraph.class_\n",
469468
"class Num(Expr):\n",
470469
" def __init__(self, i: i64Like) -> None: ...\n",
471470
"\n",
472471
" def __add__(self, other: Num) -> Num: ...\n",
473472
"\n",
474473
"\n",
475-
"@egraph.function(cost=20)\n",
474+
"@function(cost=20)\n",
476475
"def fib(x: i64Like) -> Num: ..."
477476
]
478477
},
@@ -545,7 +544,7 @@
545544
"version_minor": 0
546545
},
547546
"text/plain": [
548-
"VBox(children=(IntSlider(value=0, max=6), GraphvizWidget(dots=['digraph {stylesheet=\"/var/folders/xn/05ktz305"
547+
"VBox(children=(IntSlider(value=0, max=6), GraphvizWidget(dots=['digraph {stylesheet=\"/var/folders/xn/05ktz305\u2026"
549548
]
550549
},
551550
"execution_count": 3,
@@ -1474,7 +1473,7 @@
14741473
"version_minor": 0
14751474
},
14761475
"text/plain": [
1477-
"VBox(children=(IntSlider(value=0, max=3), GraphvizWidget(dots=['digraph {stylesheet=\"/var/folders/xn/05ktz305"
1476+
"VBox(children=(IntSlider(value=0, max=3), GraphvizWidget(dots=['digraph {stylesheet=\"/var/folders/xn/05ktz305\u2026"
14781477
]
14791478
},
14801479
"execution_count": 14,
@@ -1509,7 +1508,7 @@
15091508
"version_minor": 0
15101509
},
15111510
"text/plain": [
1512-
"VBox(children=(IntSlider(value=0, max=6), GraphvizWidget(dots=['digraph {stylesheet=\"/var/folders/xn/05ktz305"
1511+
"VBox(children=(IntSlider(value=0, max=6), GraphvizWidget(dots=['digraph {stylesheet=\"/var/folders/xn/05ktz305\u2026"
15131512
]
15141513
},
15151514
"execution_count": 15,
@@ -1542,7 +1541,7 @@
15421541
"version_minor": 0
15431542
},
15441543
"text/plain": [
1545-
"VBox(children=(IntSlider(value=0, max=9), GraphvizWidget(dots=['digraph {stylesheet=\"/var/folders/xn/05ktz305"
1544+
"VBox(children=(IntSlider(value=0, max=9), GraphvizWidget(dots=['digraph {stylesheet=\"/var/folders/xn/05ktz305\u2026"
15461545
]
15471546
},
15481547
"execution_count": 16,
@@ -1731,4 +1730,4 @@
17311730
},
17321731
"nbformat": 4,
17331732
"nbformat_minor": 5
1734-
}
1733+
}

docs/explanation/2023_11_17_pytensor.ipynb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@
133133
"egraph = EGraph()\n",
134134
"\n",
135135
"\n",
136-
"@egraph.class_\n",
137136
"class Int(Expr):\n",
138137
" def __init__(self, value: i64Like) -> None: ...\n",
139138
"\n",
@@ -144,7 +143,6 @@
144143
"converter(i64, Int, Int)\n",
145144
"\n",
146145
"\n",
147-
"@egraph.class_\n",
148146
"class IntTuple(Expr):\n",
149147
" def __init__(self, first: Int) -> None: ...\n",
150148
"\n",
@@ -183,7 +181,6 @@
183181
"Shape = IntTuple\n",
184182
"\n",
185183
"\n",
186-
"@egraph.class_\n",
187184
"class Tensor(Expr):\n",
188185
" def __init__(self, name: StringLike, shape: Shape) -> None: ...\n",
189186
"\n",
@@ -199,17 +196,15 @@
199196
" yield rewrite(Tensor(name, shape).shape).to(shape)\n",
200197
"\n",
201198
"\n",
202-
"@egraph.class_\n",
203199
"class UnaryOp(Expr):\n",
204200
" def __call__(self, x: Tensor) -> Tensor: ...\n",
205201
"\n",
206202
"\n",
207-
"@egraph.class_\n",
208203
"class BinaryOp(Expr):\n",
209204
" def __call__(self, x: Tensor, y: Tensor) -> Tensor: ...\n",
210205
"\n",
211206
"\n",
212-
"@egraph.function(cost=1)\n",
207+
"@function(cost=1)\n",
213208
"def Squeeze(axis: IntTuple) -> UnaryOp: ...\n",
214209
"\n",
215210
"\n",
@@ -258,7 +253,6 @@
258253
" yield (rewrite(Squeeze(axis=(i,))(x).shape[j]).to(x.shape[j], i > j))\n",
259254
"\n",
260255
"\n",
261-
"@egraph.class_\n",
262256
"class OpType(Expr): ...\n",
263257
"\n",
264258
"\n",
@@ -267,11 +261,11 @@
267261
"ScalarDiv = egraph.constant(\"ScalarDiv\", OpType)\n",
268262
"\n",
269263
"\n",
270-
"@egraph.function(cost=10)\n",
264+
"@function(cost=10)\n",
271265
"def Reduce(scalar_op: OpType, axis: IntTuple) -> UnaryOp: ...\n",
272266
"\n",
273267
"\n",
274-
"@egraph.function(cost=5)\n",
268+
"@function(cost=5)\n",
275269
"def Elemwise(scalar_op: OpType) -> BinaryOp: ...\n",
276270
"\n",
277271
"\n",
@@ -2527,4 +2521,4 @@
25272521
},
25282522
"nbformat": 4,
25292523
"nbformat_minor": 0
2530-
}
2524+
}

0 commit comments

Comments
 (0)