@@ -604,9 +604,8 @@ def branch_length(self, u):
604
604
605
605
>>> tree.time(tree.parent(u)) - tree.time(u)
606
606
607
- Note that this is not related to the value returned by
608
- :attr:`.length`, which describes the length of the interval
609
- covered by the tree in genomic coordinates.
607
+ (note that this is not related to the property :attr:`.length` which
608
+ is a deprecated alias for the genomic :attr:`.span` covered by a tree)
610
609
611
610
:param int u: The node of interest.
612
611
:return: The branch length from u to its parent.
@@ -915,17 +914,22 @@ def interval(self):
915
914
return self ._ll_tree .get_left (), self ._ll_tree .get_right ()
916
915
917
916
def get_length (self ):
918
- # Deprecated alias for self.length
917
+ # Deprecated alias for self.span
919
918
return self .length
920
919
921
920
@property
922
921
def length (self ):
922
+ # Deprecated alias for self.span
923
+ return self .span
924
+
925
+ @property
926
+ def span (self ):
923
927
"""
924
- Returns the length of the genomic interval that this tree represents .
928
+ Returns the genomic distance that this tree spans .
925
929
This is defined as :math:`r - l`, where :math:`(l, r)` is the genomic
926
930
interval returned by :attr:`.interval`.
927
931
928
- :return: The length of the genomic interval covered by this tree.
932
+ :return: The genomic distance covered by this tree.
929
933
:rtype: int
930
934
"""
931
935
left , right = self .get_interval ()
@@ -2631,9 +2635,9 @@ def mean_descendants(self, reference_sets):
2631
2635
Computes for every node the mean number of samples in each of the
2632
2636
`reference_sets` that descend from that node, averaged over the
2633
2637
portions of the genome for which the node is ancestral to *any* sample.
2634
- The output is an array, `C[node, j]`, which reports the total length of
2638
+ The output is an array, `C[node, j]`, which reports the total span of
2635
2639
all genomes in `reference_sets[j]` that inherit from `node`, divided by
2636
- the total length of the genome on which `node` is an ancestor to any
2640
+ the total span of the genome on which `node` is an ancestor to any
2637
2641
sample in the tree sequence.
2638
2642
2639
2643
.. note:: This interface *may change*, particularly the normalization by
@@ -2689,7 +2693,7 @@ def genealogical_nearest_neighbours(self, focal, reference_sets, num_threads=0):
2689
2693
# TODO this may not be a good name because there is another version of the
2690
2694
# statistic which may be occasionally useful where we return the tree-by-tree
2691
2695
# value. We could do this by adding an extra dimension to the returned array
2692
- # which would give the values tree-by-tree. The tree lengths can be computed
2696
+ # which would give the values tree-by-tree. The tree spans can be computed
2693
2697
# easily enough, *but* there may be occasions when the statistic isn't
2694
2698
# defined over particular trees.
2695
2699
#
0 commit comments