summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-06-07 17:37:43 +0200
committerNao Pross <np@0hm.ch>2024-06-07 17:37:43 +0200
commit17b55461612a02330ab0a0b36f8d601cd13792a6 (patch)
tree907377f98750fb60b79cb6898d217d3ff071d6d2
parentRemove trailing \n when printing PolyMatrixImpl (diff)
downloadpolymatrix-17b55461612a02330ab0a0b36f8d601cd13792a6.tar.gz
polymatrix-17b55461612a02330ab0a0b36f8d601cd13792a6.zip
Avoid using unpack operator in subscript for backwards compatibility
Was introduced only in python 3.11
-rw-r--r--polymatrix/expression/mixins/additionexprmixin.py2
-rw-r--r--polymatrix/expression/mixins/degreeexprmixin.py2
-rw-r--r--polymatrix/expression/mixins/subtractionexprmixin.py2
-rw-r--r--polymatrix/expression/to.py2
-rw-r--r--polymatrix/polymatrix/init.py2
5 files changed, 5 insertions, 5 deletions
diff --git a/polymatrix/expression/mixins/additionexprmixin.py b/polymatrix/expression/mixins/additionexprmixin.py
index 836de00..df5aed3 100644
--- a/polymatrix/expression/mixins/additionexprmixin.py
+++ b/polymatrix/expression/mixins/additionexprmixin.py
@@ -57,5 +57,5 @@ class AdditionExprMixin(ExpressionBaseMixin):
else:
new_poly[monomial] = coeff
- result[*entry] = new_poly
+ result[entry] = new_poly
return state, init_poly_matrix(result, left.shape)
diff --git a/polymatrix/expression/mixins/degreeexprmixin.py b/polymatrix/expression/mixins/degreeexprmixin.py
index 331c350..e75ea5e 100644
--- a/polymatrix/expression/mixins/degreeexprmixin.py
+++ b/polymatrix/expression/mixins/degreeexprmixin.py
@@ -39,7 +39,7 @@ class DegreeExprMixin(ExpressionBaseMixin):
if monomial.degree > max_degree:
max_degree = monomial.degree
- result[*entry] = PolyDict({
+ result[entry] = PolyDict({
MonomialIndex.constant(): max_degree
})
diff --git a/polymatrix/expression/mixins/subtractionexprmixin.py b/polymatrix/expression/mixins/subtractionexprmixin.py
index f80f7e8..49105df 100644
--- a/polymatrix/expression/mixins/subtractionexprmixin.py
+++ b/polymatrix/expression/mixins/subtractionexprmixin.py
@@ -52,6 +52,6 @@ class SubtractionExprMixin(ExpressionBaseMixin):
else:
new_poly[monomial] = -coeff
- result[*entry] = new_poly
+ result[entry] = new_poly
return state, init_poly_matrix(result, left.shape)
diff --git a/polymatrix/expression/to.py b/polymatrix/expression/to.py
index 7f9bac7..7d17ad0 100644
--- a/polymatrix/expression/to.py
+++ b/polymatrix/expression/to.py
@@ -64,7 +64,7 @@ def to_sympy(
else:
sympy_poly_terms.append(coeff * sympy_monomial)
- m[*entry] = sum(sympy_poly_terms)
+ m[entry] = sum(sympy_poly_terms)
if math.prod(pm.shape) == 1:
# just return the expression
diff --git a/polymatrix/polymatrix/init.py b/polymatrix/polymatrix/init.py
index 938f8b5..d66a3d0 100644
--- a/polymatrix/polymatrix/init.py
+++ b/polymatrix/polymatrix/init.py
@@ -31,7 +31,7 @@ def init_poly_matrix(
for monomial, coeff in poly.items():
idx = MonomialIndex(VariableIndex(*v) for v in monomial)
p[idx] = coeff
- wrapped[*entry] = p
+ wrapped[entry] = p
data = wrapped
return PolyMatrixImpl(data=data, shape=shape)