Skip to content

Commit ae215ba

Browse files
Fix mypy
1 parent 8a90cb3 commit ae215ba

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

python/egglog/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def resolve_literal(
180180
# Try all parent types as well, if we are converting from a Python type
181181
for arg_type_instance in arg_type.__mro__ if isinstance(arg_type, type) else [arg_type]:
182182
try:
183-
fn = CONVERSIONS[(cast(TypeName | type, arg_type_instance), tp_name)][1]
183+
fn = CONVERSIONS[(arg_type_instance, tp_name)][1]
184184
except KeyError:
185185
continue
186186
break

python/egglog/exp/array_api_jit.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ def jit(fn: X) -> X:
1414
"""
1515
Jit compiles a function
1616
"""
17-
from IPython.display import SVG
18-
1917
# 1. Create variables for each of the two args in the functions
2018
sig = inspect.signature(fn)
2119
arg1, arg2 = sig.parameters.keys()
@@ -25,13 +23,12 @@ def jit(fn: X) -> X:
2523
egraph.register(res)
2624
egraph.run(array_api_numba_schedule)
2725
res_optimized = egraph.extract(res)
28-
svg = SVG(egraph.graphviz_svg(split_primitive_outputs=True, n_inline_leaves=3))
26+
egraph.display(split_primitive_outputs=True, n_inline_leaves=3)
2927

3028
egraph = EGraph()
3129
fn_program = ndarray_function_two(res_optimized, NDArray.var(arg1), NDArray.var(arg2))
3230
egraph.register(fn_program)
3331
egraph.run(array_api_program_gen_schedule)
3432
fn = cast(X, egraph.eval(fn_program.py_object))
35-
fn.egraph = svg # type: ignore[attr-defined]
3633
fn.expr = res_optimized # type: ignore[attr-defined]
3734
return fn

0 commit comments

Comments
 (0)