Skip to content

Commit 169f45b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3b0ef4f commit 169f45b

30 files changed

Lines changed: 1286 additions & 1301 deletions

python/egglog/bindings.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ class Value:
181181
def __ge__(self, other: object) -> bool: ...
182182

183183
@final
184-
185184
@final
186185
class EggSmolError(Exception):
187186
context: str

python/egglog/builtins.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,6 @@ def match(self, f: Callable[[T], V], n: V) -> V: ...
494494
# def flat_map(self, f: Callable[[T], Maybe[V]]) -> Maybe[V]: ...
495495

496496

497-
498497
converter(type(None), Maybe, lambda _: Maybe[get_type_args()[0]].none())
499498
# converter(object, Maybe, lambda x: Maybe[get_type_args()[0]].some(convert(x, get_type_args()[0])))
500499

python/egglog/deconstruct.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def _deconstruct_call_decl(
196196

197197
return RuntimeFunction(decls_thunk, Thunk.value(call.callable), egg_bound), arg_exprs
198198

199+
199200
def is_expr_instance(x: BaseExpr, cls: type[T]) -> TypeIs[T]:
200201
"""
201202
Checks if the expression is an instance of the given class. Can normally use isinstance for this, but this also works for

python/egglog/egraph.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@
142142
}
143143

144144

145-
def check_eq(x: BASE_EXPR, y: BASE_EXPR, schedule: Schedule | None = None, *actions: ActionLike, display=False) -> EGraph:
145+
def check_eq(
146+
x: BASE_EXPR, y: BASE_EXPR, schedule: Schedule | None = None, *actions: ActionLike, display=False
147+
) -> EGraph:
146148
"""
147149
Verifies that two expressions are equal after running the schedule.
148150
@@ -478,9 +480,7 @@ def _generate_class_decls( # noqa: C901,PLR0912
478480
subsume=False,
479481
)
480482
resolved_default = (
481-
resolve_literal(type_ref, default_value, Thunk.value(decls))
482-
if default_mode == "eager"
483-
else None
483+
resolve_literal(type_ref, default_value, Thunk.value(decls)) if default_mode == "eager" else None
484484
)
485485
if resolved_default is not None:
486486
decls |= resolved_default
@@ -911,11 +911,7 @@ def _constant_thunk(
911911
unextractable=False,
912912
subsume=False,
913913
)
914-
resolved_default = (
915-
resolve_literal(type_ref, default_replacement, Thunk.value(decls))
916-
if mode == "eager"
917-
else None
918-
)
914+
resolved_default = resolve_literal(type_ref, default_replacement, Thunk.value(decls)) if mode == "eager" else None
919915
if resolved_default is not None:
920916
decls |= resolved_default
921917
decls._constants[ident] = ConstantDecl(
@@ -1582,11 +1578,7 @@ def all_function_sizes(self) -> list[tuple[ExprCallable, int]]:
15821578
"""
15831579
(output,) = self._state.run_program(bindings.PrintSize(span(1), None))
15841580
assert isinstance(output, bindings.PrintAllFunctionsSize)
1585-
return [
1586-
(callables[0], size)
1587-
for (name, size) in output.sizes
1588-
if (callables := self._egg_fn_to_callables(name))
1589-
]
1581+
return [(callables[0], size) for (name, size) in output.sizes if (callables := self._egg_fn_to_callables(name))]
15901582

15911583
def _egg_fn_to_callables(self, egg_fn: str) -> list[ExprCallable]:
15921584
return [

python/egglog/egraph_state.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,9 @@ def _primitive_command_to_egg(
641641
signature: FunctionSignature,
642642
body: TypedExprDecl,
643643
) -> bindings.UserDefined:
644-
input_sort_expr = self._primitive_input_sorts_to_egg(
645-
[self.type_ref_to_egg(arg_type.to_just()) for arg_type in signature.arg_types]
646-
)
644+
input_sort_expr = self._primitive_input_sorts_to_egg([
645+
self.type_ref_to_egg(arg_type.to_just()) for arg_type in signature.arg_types
646+
])
647647
output_sort_expr = bindings.Var(span(), self.type_ref_to_egg(signature.semantic_return_type.to_just()))
648648
return bindings.UserDefined(
649649
span(),

python/egglog/exp/param_eq/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44

55
from .pipeline import _cli
66

7-
87
if __name__ == "__main__":
98
_cli()

0 commit comments

Comments
 (0)