Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Mar 31, 2024
1 parent 5a10072 commit 4414985
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions galgebra/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Union

from sympy import Symbol, AtomicExpr, S, Basic, sympify, MatrixExpr, FunctionMatrix
from sympy import Symbol, AtomicExpr, S, Basic, sympify, MatrixExpr
from sympy import Determinant as _Determinant
from sympy.core import numbers
from sympy.core.function import AppliedUndef, UndefinedFunction
Expand Down Expand Up @@ -146,19 +146,20 @@ def _pretty(self, printer):
))
return prettyForm(*pform.parens())


class MatrixFunctionClass(UndefinedFunction):
""" Like a MatrixSymbol, but for functions. """
def __new__(mcl, name, shape, **kwargs):
cls = super().__new__(mcl, name, (AppliedUndef, MatrixExpr), {}, **kwargs)
m, n = shape
cls.shape = sympify(m, strict=True), sympify(n, strict=True)
return cls



# workaround until pygae/galgebra#495 is truely fixed
def MatrixFunction(name, m, n):
return MatrixFunctionClass(name, (m, n))


# workaround until sympy/sympy#19354 is merged
if _Determinant.is_commutative is not True:
class Determinant(_Determinant):
Expand Down

0 comments on commit 4414985

Please sign in to comment.