diff options
author | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2024-02-27 15:05:40 +0100 |
---|---|---|
committer | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2024-02-27 15:05:40 +0100 |
commit | acfd00e146f83ab0a7751deb89fe184e3f54e95b (patch) | |
tree | 78d0e25496ec61a159e7674bbbfc8996ea058258 | |
parent | use or instead of (diff) | |
download | polymatrix-acfd00e146f83ab0a7751deb89fe184e3f54e95b.tar.gz polymatrix-acfd00e146f83ab0a7751deb89fe184e3f54e95b.zip |
bugfix after shadowing existing variable when renaming
-rw-r--r-- | polymatrix/expression/mixins/sumexprmixin.py | 7 |
1 files 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: |