@@ -7451,11 +7451,20 @@ def union(
7451
7451
4. Sites which were not present in ``self``, if the site contains a newly
7452
7452
added mutation.
7453
7453
7454
- By default, populations of newly added nodes are assumed to be new
7455
- populations, and added to the population table as well. This can be
7456
- thought of as a "node-wise" union: for instance, it can not be used
7457
- to add new edges between two nodes already in ``self`` or new mutations
7458
- above nodes already in ``self``.
7454
+ This can be thought of as a "node-wise" union: for instance, it can not
7455
+ be used to add new edges between two nodes already in ``self`` or new
7456
+ mutations above nodes already in ``self``.
7457
+
7458
+ By default, with ``add_populations=True``, populations of all newly added
7459
+ nodes are assumed to be new populations, and added to the end of the
7460
+ population table as well. This is appropriate if all nodes to be added
7461
+ are from distinct populations not already in ``self`` and ordering of
7462
+ populations is not important. On the other hand, if
7463
+ ``add_populations=False`` then no new populations are added, so any
7464
+ populations referred to in ``other`` must already exist in ``self``.
7465
+ If some new nodes are in populations already in ``self`` but other new
7466
+ nodes are in entirely new populations, then you must set up the
7467
+ population table first, and then union with ``add_populations=False``.
7459
7468
7460
7469
If the resulting tree sequence is invalid (for instance, a node is
7461
7470
specified to have two distinct parents on the same interval),
0 commit comments