@@ -7517,6 +7517,24 @@ def union(
75177517 nodes are in entirely new populations, then you must set up the
75187518 population table first, and then union with ``add_populations=False``.
75197519
7520+ This method makes sense if the "shared" portions of the tree sequences
7521+ are equal; the option ``check_shared_equality`` performs a consistency
7522+ check that this is true. If this check is disabled, it is very easy to
7523+ produce nonsensical results via subtle inconsistencies.
7524+
7525+ The behavior above can be changed by ``all_edges`` and ``all_mutations``.
7526+ If ``all_edges`` is True, then all edges in ``other` are added to
7527+ ``self``, instead of only edges adjacent to added nodes. If
7528+ ``all_mutations`` is True, then similarly all mutations in ``other``
7529+ are added (not just those on added nodes); furthermore, all sites
7530+ at positions without a site already present are added to ``self``.
7531+ The intended use case for these options is a "disjoint" union,
7532+ where for instance the two tree sequences contain information about
7533+ disjoint segments of the genome (see :meth:`.concatenate`).
7534+ For some such applications it may be necessary to set
7535+ ``check_shared_overlap=False`` (but also easier to check for validity
7536+ separately).
7537+
75207538 If the resulting tree sequence is invalid (for instance, a node is
75217539 specified to have two distinct parents on the same interval),
75227540 an error will be raised.
0 commit comments