diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 775bae9..b3a24ea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ exclude: ^python/tests/__snapshots__/ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.3 + rev: v0.8.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/python/egglog/builtins.py b/python/egglog/builtins.py index bbb687b..d23caa3 100644 --- a/python/egglog/builtins.py +++ b/python/egglog/builtins.py @@ -22,24 +22,24 @@ __all__ = [ - "i64", - "i64Like", - "f64", - "f64Like", "Bool", "BoolLike", - "String", - "StringLike", "Map", + "PyObject", "Rational", "Set", + "String", + "StringLike", + "UnstableFn", "Vec", + "f64", + "f64Like", + "i64", + "i64Like", "join", - "PyObject", "py_eval", - "py_exec", "py_eval_fn", - "UnstableFn", + "py_exec", ] diff --git a/python/egglog/conversion.py b/python/egglog/conversion.py index 1abb636..e2cb7fb 100644 --- a/python/egglog/conversion.py +++ b/python/egglog/conversion.py @@ -15,7 +15,7 @@ from .egraph import Expr -__all__ = ["convert", "converter", "resolve_literal", "convert_to_same_type"] +__all__ = ["convert", "convert_to_same_type", "converter", "resolve_literal"] # Mapping from (source type, target type) to and function which takes in the runtimes values of the source and return the target TypeName = NewType("TypeName", str) CONVERSIONS: dict[tuple[type | TypeName, TypeName], tuple[int, Callable]] = {} diff --git a/python/egglog/declarations.py b/python/egglog/declarations.py index 86ad479..ad7d283 100644 --- a/python/egglog/declarations.py +++ b/python/egglog/declarations.py @@ -17,65 +17,65 @@ __all__ = [ - "replace_typed_expr", + "ActionCommandDecl", + "ActionDecl", + "BiRewriteDecl", + "CallDecl", + "CallableDecl", + "CallableRef", + "ChangeDecl", + "ClassDecl", + "ClassMethodRef", + "ClassTypeVarRef", + "ClassVariableRef", + "CombinedRulesetDecl", + "CommandDecl", + "ConstantDecl", + "ConstantRef", + "Declarations", "Declarations", "DeclerationsLike", + "DefaultRewriteDecl", "DelayedDeclerations", - "upcast_declerations", - "Declarations", + "EqDecl", + "ExprActionDecl", + "ExprDecl", + "ExprFactDecl", + "FactDecl", + "FunctionDecl", + "FunctionRef", + "FunctionSignature", + "HasDeclerations", + "InitRef", "JustTypeRef", - "ClassTypeVarRef", - "TypeRefWithVars", - "TypeOrVarRef", + "LetDecl", + "LitDecl", + "LitType", "MethodRef", - "ClassMethodRef", - "FunctionRef", - "UnnamedFunctionRef", - "ConstantRef", - "ClassVariableRef", + "PanicDecl", + "PartialCallDecl", "PropertyRef", - "CallableRef", - "FunctionDecl", - "RelationDecl", - "ConstantDecl", - "CallableDecl", - "VarDecl", "PyObjectDecl", - "PartialCallDecl", - "LitType", - "LitDecl", - "CallDecl", - "ExprDecl", - "TypedExprDecl", - "ClassDecl", - "RulesetDecl", - "CombinedRulesetDecl", - "SaturateDecl", + "RelationDecl", "RepeatDecl", - "SequenceDecl", + "RewriteDecl", + "RewriteOrRuleDecl", + "RuleDecl", + "RulesetDecl", "RunDecl", + "SaturateDecl", "ScheduleDecl", - "EqDecl", - "ExprFactDecl", - "FactDecl", - "LetDecl", + "SequenceDecl", "SetDecl", - "ExprActionDecl", - "ChangeDecl", - "UnionDecl", - "PanicDecl", - "ActionDecl", - "RewriteDecl", - "BiRewriteDecl", - "RuleDecl", - "RewriteOrRuleDecl", - "ActionCommandDecl", - "CommandDecl", "SpecialFunctions", - "FunctionSignature", - "DefaultRewriteDecl", - "InitRef", - "HasDeclerations", + "TypeOrVarRef", + "TypeRefWithVars", + "TypedExprDecl", + "UnionDecl", + "UnnamedFunctionRef", + "VarDecl", + "replace_typed_expr", + "upcast_declerations", ] diff --git a/python/egglog/egraph.py b/python/egglog/egraph.py index 1cc4135..f834a18 100644 --- a/python/egglog/egraph.py +++ b/python/egglog/egraph.py @@ -42,53 +42,53 @@ __all__ = [ + "Action", + "Command", + "Command", "EGraph", - "Module", - "function", - "ruleset", - "method", - "relation", "Expr", + "Fact", + "Fact", + "GraphvizKwargs", + "Module", + "RewriteOrRule", + "Ruleset", + "Schedule", "Unit", - "rewrite", + "_BirewriteBuilder", + "_EqBuilder", + "_NeBuilder", + "_RewriteBuilder", + "_SetBuilder", + "_UnionBuilder", + "action_command", "birewrite", - "eq", - "ne", - "panic", - "let", + "check", + "check_eq", "constant", "delete", - "subsume", - "union", - "set_", - "rule", - "var", - "vars_", - "Fact", - "expr_parts", + "eq", "expr_action", "expr_fact", - "action_command", - "Schedule", + "expr_parts", + "function", + "let", + "method", + "ne", + "panic", + "relation", + "rewrite", + "rule", + "ruleset", "run", "seq", - "Command", + "set_", "simplify", + "subsume", + "union", "unstable_combine_rulesets", - "check", - "GraphvizKwargs", - "Ruleset", - "_RewriteBuilder", - "_BirewriteBuilder", - "_EqBuilder", - "_NeBuilder", - "_SetBuilder", - "_UnionBuilder", - "RewriteOrRule", - "Fact", - "Action", - "Command", - "check_eq", + "var", + "vars_", ] T = TypeVar("T") diff --git a/python/egglog/egraph_state.py b/python/egglog/egraph_state.py index 2c3adfe..90a40ba 100644 --- a/python/egglog/egraph_state.py +++ b/python/egglog/egraph_state.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: from collections.abc import Iterable -__all__ = ["EGraphState", "GLOBAL_PY_OBJECT_SORT"] +__all__ = ["GLOBAL_PY_OBJECT_SORT", "EGraphState"] # Create a global sort for python objects, so we can store them without an e-graph instance # Needed when serializing commands to egg commands when creating modules diff --git a/python/egglog/pretty.py b/python/egglog/pretty.py index 4e44e34..cffc5a8 100644 --- a/python/egglog/pretty.py +++ b/python/egglog/pretty.py @@ -18,10 +18,10 @@ __all__ = [ - "pretty_decl", - "pretty_callable_ref", "BINARY_METHODS", "UNARY_METHODS", + "pretty_callable_ref", + "pretty_decl", ] MAX_LINE_LENGTH = 110 LINE_DIFFERENCE = 10 diff --git a/python/egglog/runtime.py b/python/egglog/runtime.py index df891be..b6741c2 100644 --- a/python/egglog/runtime.py +++ b/python/egglog/runtime.py @@ -29,12 +29,12 @@ __all__ = [ "LIT_CLASS_NAMES", - "resolve_callable", - "resolve_type_annotation", + "REFLECTED_BINARY_METHODS", "RuntimeClass", "RuntimeExpr", "RuntimeFunction", - "REFLECTED_BINARY_METHODS", + "resolve_callable", + "resolve_type_annotation", ] diff --git a/python/egglog/type_constraint_solver.py b/python/egglog/type_constraint_solver.py index c473729..6f44735 100644 --- a/python/egglog/type_constraint_solver.py +++ b/python/egglog/type_constraint_solver.py @@ -15,7 +15,7 @@ from collections.abc import Collection, Iterable -__all__ = ["TypeConstraintSolver", "TypeConstraintError"] +__all__ = ["TypeConstraintError", "TypeConstraintSolver"] class TypeConstraintError(RuntimeError):