From 662f53a880943264a4a1eec0f6a020f4e7cd4557 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 4 May 2024 22:29:52 +0200 Subject: Remove circularity in FromSympyExpr by using polymatrix.variable --- polymatrix/expression/mixins/fromsympyexprmixin.py | 7 ++----- 1 file 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) } -- cgit v1.2.1