Skip to content

Commit

Permalink
docstring flailing
Browse files Browse the repository at this point in the history
  • Loading branch information
petrelharp committed Aug 3, 2023
1 parent 33ff451 commit a91f6ea
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions python/tskit/trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -6822,19 +6822,21 @@ def decapitate(self, time, *, flags=None, population=None, metadata=None):

def extend_edges(self, max_iter=10):
"""
Returns a new tree sequence whose unary nodes are extended to
neighboring trees given the following condition: While iterating over
the tree sequence, in each tree, we identify connecting edges with
unary nodes. If an equivalent edge segment exists in the next tree
without that unary node, we extend the connecting edges from the
previous tree into the next tree, subsequently adding that unary node
to the tree. This in turn reduces the length of the edge just removed
from the next tree, and if its length becomes zero it is removed from
the edge table.
: param max_iters: (int) -- the number of iterations we analyze the
tree sequence to edge extend. The process will halt if there is no
change in edge count over two consecutive iterations.
TODO: make this better
Returns a new tree sequence in which the span covered by ancestral nodes
is "extended" to regions of the genome over which their ancestry is
unambiguous, which occurs if the node is an intermediate in a chain
of ancestry that also exists in neighboring regions of the genome.
While iterating over the tree sequence, in each tree, we identify
connecting edges with unary nodes. If an equivalent edge segment
exists in the next tree without that unary node, we extend the
connecting edges from the previous tree into the next tree,
subsequently adding that unary node to the tree. This in turn reduces
the length of the edge just removed from the next tree, and if its
length becomes zero it is removed from the edge table.
:param int max_iters: The maximum number of forward-and-backward
iterations over the tree sequence. Defaults to 10.
:return: A new tree sequence with unary nodes extended.
:rtype: tskit.TreeSequence
Expand Down

0 comments on commit a91f6ea

Please sign in to comment.