summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polymatrix/expression/mixins/variablemixin.py3
-rw-r--r--polymatrix/expressionstate/mixins.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/polymatrix/expression/mixins/variablemixin.py b/polymatrix/expression/mixins/variablemixin.py
index ffac1f8..6a79f27 100644
--- a/polymatrix/expression/mixins/variablemixin.py
+++ b/polymatrix/expression/mixins/variablemixin.py
@@ -19,7 +19,8 @@ class VariableMixin(ExpressionBaseMixin, Variable):
@override
def apply(self, state: ExpressionStateMixin) -> tuple[ExpressionStateMixin, PolyMatrixMixin]:
- state, indices = state.index(self)
+ state = state.register(self)
+ indices = state.get_indices(self)
p = PolyMatrixDict()
rows, cols = self.shape
diff --git a/polymatrix/expressionstate/mixins.py b/polymatrix/expressionstate/mixins.py
index e4da232..71add07 100644
--- a/polymatrix/expressionstate/mixins.py
+++ b/polymatrix/expressionstate/mixins.py
@@ -70,7 +70,7 @@ class ExpressionStateMixin(
the variables, one for each entry.
"""
if var not in self.indices:
- raise IndexError(f"There is no variable with index {index}.")
+ raise IndexError(f"There is no variable {var} in this state object.")
yield from range(*self.indices[var])