diff options
author | Nao Pross <np@0hm.ch> | 2024-03-03 17:47:27 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-03-03 17:47:27 +0100 |
commit | d1a453803b419e59d2e9bcd60a1851f43f08aadd (patch) | |
tree | a4dd646a54740ecbd68bf53913bc6f406e47da62 | |
parent | Fix typo in method name (diff) | |
download | mdpoly-d1a453803b419e59d2e9bcd60a1851f43f08aadd.tar.gz mdpoly-d1a453803b419e59d2e9bcd60a1851f43f08aadd.zip |
Rename Repr.nodes() to Repr.children()
This is to avoid confusing code like node.nodes()
-rw-r--r-- | mdpoly/abc.py | 2 | ||||
-rw-r--r-- | 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 |