diff options
author | Nao Pross <np@0hm.ch> | 2024-05-04 22:29:52 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-05-04 22:29:52 +0200 |
commit | 662f53a880943264a4a1eec0f6a020f4e7cd4557 (patch) | |
tree | a111f891c3acb2c2d91fcbd9b1d631e454467fa8 | |
parent | Fix regression in ElemMultExpr (diff) | |
download | polymatrix-662f53a880943264a4a1eec0f6a020f4e7cd4557.tar.gz polymatrix-662f53a880943264a4a1eec0f6a020f4e7cd4557.zip |
Remove circularity in FromSympyExpr by using polymatrix.variable
-rw-r--r-- | polymatrix/expression/mixins/fromsympyexprmixin.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/polymatrix/expression/mixins/fromsympyexprmixin.py b/polymatrix/expression/mixins/fromsympyexprmixin.py index 5625651..784ba00 100644 --- a/polymatrix/expression/mixins/fromsympyexprmixin.py +++ b/polymatrix/expression/mixins/fromsympyexprmixin.py @@ -15,6 +15,7 @@ from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin from polymatrix.polymatrix.abc import PolyMatrix from polymatrix.polymatrix.init import init_poly_matrix from polymatrix.polymatrix.typing import PolyMatrixDict, PolyDict, MonomialIndex, VariableIndex +from polymatrix.variable.init import init_variable class FromSympyExprMixin(ExpressionBaseMixin): @@ -75,12 +76,8 @@ class FromSympyExprMixin(ExpressionBaseMixin): "into a polynomial, are you sure it is a polynomial?") from e # Convert sympy variables to our variables, i.e VariableMixin - # FIXME: This import cannot be above because of circular imports - # not sure how I am supposed to fit this in correctly into the - # dataclass + mixin pattern structure - from polymatrix.expression.init import init_variable_expr sympy_to_var = { - sympy_idx: init_variable_expr(var.name) + sympy_idx: init_variable(var.name, shape=(1,1)) for sympy_idx, var in enumerate(sympy_poly.gens) } |