From 1589d970234c6dddb29d22adc8df8ae979b21089 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 10 May 2024 16:46:17 +0200 Subject: Minor changes in ExpressionState --- polymatrix/expressionstate/mixins.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/polymatrix/expressionstate/mixins.py b/polymatrix/expressionstate/mixins.py index f5a0c25..5d26c89 100644 --- a/polymatrix/expressionstate/mixins.py +++ b/polymatrix/expressionstate/mixins.py @@ -64,7 +64,7 @@ class ExpressionStateMixin( """ Create an index for a variable, but does not return the index. If you want the index use - :py:meth:`polymatrix.expressionstate.mixins.ExpressionStateMixin.index` + :py:meth:`index` """ state, _ = self.index(var) return state @@ -90,7 +90,8 @@ class ExpressionStateMixin( See also :py:meth:`get_indices`, :py:class:`polymatrix.polymatrix.index.VariableIndex`. """ - yield from map(lambda i: VariableIndex(index=i, power=1), self.get_indices(var)) + yield from (VariableIndex(index=i, power=1) + for i in self.get_indices(var)) def get_indices_as_monomial_index(self, var: Variable) -> Iterable[MonomialIndex]: """ @@ -99,7 +100,8 @@ class ExpressionStateMixin( See also :py:meth:`get_indices`, :py:class:`polymatrix.polymatrix.index.MonomialIndex`. """ - yield from map(lambda v: MonomialIndex((v,)), self.get_indices_as_variable_index(var)) + yield from (MonomialIndex((v,)) + for v in self.get_indices_as_variable_index(var)) def get_variable(self, index: int) -> Variable: """ Get the variable object from its index. """ -- cgit v1.2.1