Skip to content

Commit

Permalink
Merge pull request #1948 from hyanwong/traversals-doc-ref
Browse files Browse the repository at this point in the history
 Add reference to tutorials order section
  • Loading branch information
mergify[bot] authored Nov 26, 2021
2 parents 089f165 + 880220d commit bc10f93
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/tskit/trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -2250,19 +2250,20 @@ def nodes(self, root=None, order="preorder"):
Unlike the :meth:`TreeSequence.nodes` method, this iterator produces
integer node IDs, not :class:`Node` objects.
If the ``root`` parameter is not provided or none, iterate over all
If the ``root`` parameter is not provided or ``None``, iterate over all
nodes reachable from the roots (see :meth:`Tree.roots` for details
on which nodes are considered roots). If the ``root`` parameter
is provided, only the nodes in the subtree rooted at this node
(including the specified node) will be iterated over. If the
:attr:`.virtual_root` is specified as the traversal root, it will
be included in the traversed nodes in the appropriate position
for the given ordering. (See the
:ref:`tree roots <sec_data_model_tree_roots>` section for more
:ref:`tree roots <sec_data_model_tree_virtual_root>` section for more
information on the virtual root.)
The ``order`` parameter defines the order in which tree nodes
are visited in the iteration. The available orders are:
The ``order`` parameter defines the order in which tree nodes are visited
in the iteration (also see the :ref:`sec_analysing_trees_traversals` section
in the `tutorials <https://tskit.dev/tutorials>`__). The available orders are:
- 'preorder': starting at root, yield the current node, then recurse
and do a preorder on each child of the current node. See also `Wikipedia
Expand Down

0 comments on commit bc10f93

Please sign in to comment.