Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 5, 2024
1 parent 9ff08b1 commit 9dc5452
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 34 deletions.
1 change: 0 additions & 1 deletion python/egglog/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,4 +587,3 @@ def py_exec(code: StringLike, globals: object = PyObject.dict(), locals: object
"""
Copies the locals, execs the Python code, and returns the locals with any updates.
"""
...
6 changes: 0 additions & 6 deletions python/egglog/examples/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,31 @@ def identity(cls, dim: Dim) -> Matrix: # type: ignore[empty-body]
"""
Create an identity matrix of the given dimension.
"""
...

@egraph.method(egg_fn="NamedMat")
@classmethod
def named(cls, name: StringLike) -> Matrix: # type: ignore[empty-body]
"""
Create a named matrix.
"""
...

@egraph.method(egg_fn="MMul")
def __matmul__(self, other: Matrix) -> Matrix: # type: ignore[empty-body]
"""
Matrix multiplication.
"""
...

@egraph.method(egg_fn="nrows")
def nrows(self) -> Dim: # type: ignore[empty-body]
"""
Number of rows in the matrix.
"""
...

@egraph.method(egg_fn="ncols")
def ncols(self) -> Dim: # type: ignore[empty-body]
"""
Number of columns in the matrix.
"""
...


@egraph.function(egg_fn="Kron")
Expand All @@ -89,7 +84,6 @@ def kron(a: Matrix, b: Matrix) -> Matrix: # type: ignore[empty-body]
https://en.wikipedia.org/wiki/Kronecker_product#Definition
"""
...


A, B, C, D = vars_("A B C D", Matrix)
Expand Down
14 changes: 0 additions & 14 deletions python/egglog/exp/array_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ def dtype(self) -> DType:
"""
Default dtype for this scalar value
"""
...

@property
def to_bool(self) -> Boolean:
Expand All @@ -587,7 +586,6 @@ def to_truthy_value(self) -> Value:
https://data-apis.org/array-api/2022.12/API_specification/generated/array_api.any.html
"""
...


converter(Int, Value, Value.int)
Expand Down Expand Up @@ -673,7 +671,6 @@ def possible_values(values: Value) -> TupleValue:
"""
A value that is one of the values in the tuple.
"""
...


@array_api_module.class_
Expand Down Expand Up @@ -841,7 +838,6 @@ def T(self) -> NDArray: # noqa: N802
"""
https://data-apis.org/array-api/2022.12/API_specification/generated/array_api.array.T.html#array_api.array.T
"""
...

@classmethod
def vector(cls, values: TupleValue) -> NDArray:
Expand All @@ -851,15 +847,13 @@ def index(self, indices: TupleInt) -> Value:
"""
Return the value at the given indices.
"""
...


@array_api_module.function
def ndarray_index(x: NDArray) -> IndexKey:
"""
Indexes by a masked array
"""
...


converter(NDArray, IndexKey, ndarray_index)
Expand Down Expand Up @@ -1048,7 +1042,6 @@ def sum(x: NDArray, axis: OptionalIntOrTuple = OptionalIntOrTuple.none) -> NDArr
"""
https://data-apis.org/array-api/2022.12/API_specification/generated/array_api.sum.html?highlight=sum
"""
...


@array_api_module.register
Expand Down Expand Up @@ -1235,7 +1228,6 @@ def svd(x: NDArray, full_matrices: Boolean = TRUE) -> TupleNDArray:
"""
https://data-apis.org/array-api/2022.12/extensions/generated/array_api.linalg.svd.html
"""
...


@array_api_module.register
Expand Down Expand Up @@ -1282,15 +1274,13 @@ def broadcast_index(from_shape: TupleInt, to_shape: TupleInt, index: TupleInt) -
"""
Returns the index in the original array of the given index in the broadcasted array.
"""
...


@array_api_module.function
def broadcast_shapes(shape1: TupleInt, shape2: TupleInt) -> TupleInt:
"""
Returns the shape of the broadcasted array.
"""
...


@array_api_module.register
Expand Down Expand Up @@ -1424,7 +1414,6 @@ def assume_dtype(x: NDArray, dtype: DType) -> None:
"""
Asserts that the dtype of x is dtype.
"""
...


@array_api_module.register
Expand All @@ -1441,7 +1430,6 @@ def assume_shape(x: NDArray, shape: TupleInt) -> None:
"""
Asserts that the shape of x is shape.
"""
...


@array_api_module.register
Expand All @@ -1458,7 +1446,6 @@ def assume_isfinite(x: NDArray) -> None:
"""
Asserts that the scalar ndarray is non null and not infinite.
"""
...


@array_api_module.register
Expand All @@ -1479,7 +1466,6 @@ def assume_value_one_of(x: NDArray, values: TupleValue) -> None:
"""
A value that is one of the values in the tuple.
"""
...


@array_api_module.register
Expand Down
1 change: 0 additions & 1 deletion python/egglog/exp/array_api_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def count_values(x: NDArray, values: NDArray) -> TupleValue:
"""
Returns a tuple of the count of each of the values in the array.
"""
...


@array_api_numba_module.register
Expand Down
12 changes: 0 additions & 12 deletions python/egglog/exp/program_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,59 +25,50 @@ def __init__(self, expr: StringLike, is_identifier: BoolLike = Bool(False)) -> N
"""
Create a program based on a string expression.
"""
...

def __add__(self, other: ProgramLike) -> Program:
"""
Concats the strings of the two expressions and also the statements.
"""
...

@program_gen_module.method(unextractable=True)
def statement(self, statement: ProgramLike) -> Program:
"""
Uses the expression of the statement and adds that as a statement to the program.
"""
...

def assign(self) -> Program:
"""
Returns a new program with the expression assigned to a gensym.
"""
...

def function_two(self, arg1: ProgramLike, arg2: ProgramLike, name: StringLike = String("__fn")) -> Program:
"""
Returns a new program defining a function with two arguments.
"""
...

def expr_to_statement(self) -> Program:
"""
Returns a new program with the expression as a statement and the new expression empty.
"""
...

@property
def expr(self) -> String:
"""
Returns the expression of the program, if it's been compiled
"""
...

@property
def statements(self) -> String:
"""
Returns the statements of the program, if it's been compiled
"""
...

@property
def next_sym(self) -> i64:
"""
Returns the next gensym to use. This is set after calling `compile(i)` on a program.
"""
...

@program_gen_module.method(default=Unit())
def compile(self, next_sym: i64 = i64(0)) -> Unit:
Expand All @@ -93,7 +84,6 @@ def parent(self) -> Program:
Only keeps the original parent, not any additional ones, so that each set of statements is only added once.
"""
...

@program_gen_module.method(default=Unit())
def eval_py_object(self, globals: object) -> Unit:
Expand All @@ -108,14 +98,12 @@ def py_object(self) -> PyObject:
"""
Returns the python object of the program, if it's been evaluated.
"""
...

@property
def is_identifer(self) -> Bool:
"""
Returns whether the expression is an identifier. Used so that we don't re-assign any identifiers.
"""
...


converter(String, Program, Program)
Expand Down

0 comments on commit 9dc5452

Please sign in to comment.