diff options
author | Nao Pross <np@0hm.ch> | 2024-05-10 16:46:17 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-05-10 16:46:17 +0200 |
commit | 1589d970234c6dddb29d22adc8df8ae979b21089 (patch) | |
tree | 7cc85972e0eae3a33353035b798b8705f9c10b5f | |
parent | Reintroduce __truediv__ for int and float types (diff) | |
download | polymatrix-1589d970234c6dddb29d22adc8df8ae979b21089.tar.gz polymatrix-1589d970234c6dddb29d22adc8df8ae979b21089.zip |
Minor changes in ExpressionState
-rw-r--r-- | polymatrix/expressionstate/mixins.py | 8 |
1 files 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. """ |