summaryrefslogtreecommitdiffstats
path: root/polymatrix/expression/mixins/derivativeexprmixin.py
diff options
context:
space:
mode:
authorMichael Schneeberger <michael.schneeberger@fhnw.ch>2023-01-30 16:19:24 +0100
committerMichael Schneeberger <michael.schneeberger@fhnw.ch>2023-01-30 16:19:24 +0100
commit09175e1f03dc260f743de28d47a16d2f5a97bf38 (patch)
tree09320967339e60467c3f6f2a2fb6d999f112e8b5 /polymatrix/expression/mixins/derivativeexprmixin.py
parentupdate README (diff)
downloadpolymatrix-09175e1f03dc260f743de28d47a16d2f5a97bf38.tar.gz
polymatrix-09175e1f03dc260f743de28d47a16d2f5a97bf38.zip
bugfix in eval/substitution operator
Diffstat (limited to 'polymatrix/expression/mixins/derivativeexprmixin.py')
-rw-r--r--polymatrix/expression/mixins/derivativeexprmixin.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/polymatrix/expression/mixins/derivativeexprmixin.py b/polymatrix/expression/mixins/derivativeexprmixin.py
index 5fce215..183608b 100644
--- a/polymatrix/expression/mixins/derivativeexprmixin.py
+++ b/polymatrix/expression/mixins/derivativeexprmixin.py
@@ -7,7 +7,7 @@ from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin
from polymatrix.polymatrix.polymatrix import PolyMatrix
from polymatrix.expressionstate.expressionstate import ExpressionState
from polymatrix.expression.utils.getderivativemonomials import get_derivative_monomials
-from polymatrix.expression.utils.getvariableindices import get_variable_indices
+from polymatrix.expression.utils.getvariableindices import get_variable_indices_from_variable
class DerivativeExprMixin(ExpressionBaseMixin):
@@ -18,7 +18,7 @@ class DerivativeExprMixin(ExpressionBaseMixin):
@property
@abc.abstractmethod
- def variables(self) -> typing.Union[tuple, ExpressionBaseMixin]:
+ def variables(self) -> ExpressionBaseMixin:
...
@property
@@ -33,7 +33,7 @@ class DerivativeExprMixin(ExpressionBaseMixin):
) -> tuple[ExpressionState, PolyMatrix]:
state, underlying = self.underlying.apply(state=state)
- state, diff_wrt_variables = get_variable_indices(state, self.variables)
+ state, diff_wrt_variables = get_variable_indices_from_variable(state, self.variables)
assert underlying.shape[1] == 1, f'{underlying.shape=}'