From acfd00e146f83ab0a7751deb89fe184e3f54e95b Mon Sep 17 00:00:00 2001 From: Michael Schneeberger Date: Tue, 27 Feb 2024 15:05:40 +0100 Subject: bugfix after shadowing existing variable when renaming --- polymatrix/expression/mixins/sumexprmixin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/polymatrix/expression/mixins/sumexprmixin.py b/polymatrix/expression/mixins/sumexprmixin.py index 83f9397..8e649d3 100644 --- a/polymatrix/expression/mixins/sumexprmixin.py +++ b/polymatrix/expression/mixins/sumexprmixin.py @@ -34,13 +34,14 @@ class SumExprMixin(ExpressionBaseMixin): for row in range(underlying.shape[0]): for col in range(underlying.shape[1]): - polynomial = underlying.get_poly(row, col) - if polynomial is None: + underlying_poly = underlying.get_poly(row, col) + + if underlying_poly is None: continue polynomial = poly_matrix_data[row, 0] - for monomial, value in polynomial.items(): + for monomial, value in underlying_poly.items(): if monomial in polynomial: polynomial[monomial] += value else: -- cgit v1.2.1