File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5047,6 +5047,13 @@ def test_union_empty(self):
5047
5047
uni .union (empty_tables , [])
5048
5048
tables .assert_equals (uni , ignore_provenance = True )
5049
5049
5050
+ def test_contradictory_children (self ):
5051
+ # these are identical
5052
+ ts1 = tskit .Tree .generate_comb (2 , span = 2 ).tree_sequence
5053
+ ts2 = tskit .Tree .generate_comb (2 , span = 2 ).tree_sequence
5054
+ with pytest .raises (_tskit .LibraryError , match = "contradictory children" ):
5055
+ _ = ts1 .union (ts2 , node_mapping = [0 , 1 , - 1 ])
5056
+
5050
5057
def test_noshared_example (self ):
5051
5058
ts1 = self .get_msprime_example (sample_size = 3 , T = 2 , seed = 9328 )
5052
5059
ts2 = self .get_msprime_example (sample_size = 3 , T = 2 , seed = 2125 )
Original file line number Diff line number Diff line change @@ -7402,7 +7402,13 @@ def union(
7402
7402
added mutation.
7403
7403
7404
7404
By default, populations of newly added nodes are assumed to be new
7405
- populations, and added to the population table as well.
7405
+ populations, and added to the population table as well. This can be
7406
+ thought of as a "node-wise" union: for instance, it can not be used
7407
+ to add new edges between nodes already in ``self``.
7408
+
7409
+ If the resulting tree sequence is invalid (for instance, a node is
7410
+ specified to have two distinct parents on the same interval),
7411
+ an error will be raised.
7406
7412
7407
7413
Note that this operation also sorts the resulting tables, so the
7408
7414
resulting tree sequence may not be equal to ``self`` even if nothing
You can’t perform that action at this time.
0 commit comments