You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
timeasc/timedesc node orderings only hold *within* a particular root #1776
If we have two disconnected subtrees in a tree, the tree.nodes(order="timeasc") function currently visits nodes in one subtree first in time order, then the other.
It would be more consistent and logical if all nodes in the tree were visited in time order.
which means we sort by time first then by node ID. I would have thought it simpler/more logical to leave the natural preorder tree ordering within a node. (The "levelorder" isn't needed either, since we're totally ordering)
I'm working through traversal semantics right now as part of #1704 - I think it'll be easiest to change it to be global rather than per root. This will be a good time to change it, since we'll be doing the virtual root as part of 0.4.0
Activity
jeromekelleher commentedon Oct 9, 2021
Also we're currently defining it like this:
which means we sort by time first then by node ID. I would have thought it simpler/more logical to leave the natural preorder tree ordering within a node. (The "levelorder" isn't needed either, since we're totally ordering)
jeromekelleher commentedon Oct 9, 2021
Also true for
levelorder.benjeffery commentedon Oct 11, 2021
All the sorting methods go root-by-root, I assume for the others this is OK as they are topological.
jeromekelleher commentedon Oct 11, 2021
I'm working through traversal semantics right now as part of #1704 - I think it'll be easiest to change it to be global rather than per root. This will be a good time to change it, since we'll be doing the virtual root as part of 0.4.0
Update node traversals and virual root semantics
Update node traversals and virual root semantics
Update node traversals and virual root semantics
Update node traversals and virual root semantics
Update node traversals and virual root semantics
Update node traversals and virual root semantics
Update node traversals and virual root semantics
Refactor node traversal tests
Refactor node traversal tests