From d1a453803b419e59d2e9bcd60a1851f43f08aadd Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 3 Mar 2024 17:47:27 +0100 Subject: Rename Repr.nodes() to Repr.children() This is to avoid confusing code like node.nodes() --- mdpoly/abc.py | 2 +- mdpoly/algebra.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mdpoly/abc.py b/mdpoly/abc.py index b127e8b..9977d65 100644 --- a/mdpoly/abc.py +++ b/mdpoly/abc.py @@ -26,7 +26,7 @@ class Expr(Protocol): name = self.__class__.__qualname__ return f"{name}(left={self.left}, right={self.right})" - def nodes(self) -> Sequence[Self]: + def children(self) -> Sequence[Self]: """ Iterate over the two nodes """ return self.left, self.right diff --git a/mdpoly/algebra.py b/mdpoly/algebra.py index 5b3c597..6f046b7 100644 --- a/mdpoly/algebra.py +++ b/mdpoly/algebra.py @@ -183,7 +183,7 @@ class Add(Expr, HasRepr, PolyRingAlgebra): entry = MatrixIndex.scalar # Make representations for existing stuff - for node in self.nodes(): + for node in self.children(): nrepr, state = node.to_repr(repr_type, state) # Process non-zero terms -- cgit v1.2.1