File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -507,6 +507,14 @@ Descendant nodes
507
507
Tree.num_samples
508
508
Tree.num_tracked_samples
509
509
510
+ Note that :meth:Tree.num_samples provides an efficient way to count samples under a node.
511
+ However, samples and leaves are not always equivalent: some samples may be internal nodes,
512
+ some leaves may not be samples (in unsimplified tree sequences), and the same node can be
513
+ a leaf in one tree but internal in another. While `tree.num_samples` often equals the leaf
514
+ count (particularly in simplified tree sequences without internal samples), a strict leaf
515
+ count requires tree traversal, e.g. via `num_leaves = len(list(tree.leaves()))`.
516
+
517
+
510
518
Multiple nodes
511
519
.. autosummary::
512
520
Tree.is_descendant
You can’t perform that action at this time.
0 commit comments