File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -266,8 +266,11 @@ def _process_l2_agglomeration(
266266 cross_edges = agg .cross_edges .get_pairs ()
267267 # we must avoid the cache to read roots to get segment state before edit began
268268 parents = cg .get_parents (cross_edges [:, 0 ], time_stamp = parent_ts , raw_only = True )
269+
270+ # if there are cross edges, there must be a single parent.
271+ # if there aren't any, there must be no parents. XOR these 2 conditions.
269272 err = f"got cross edges from more than one l2 node; op { operation_id } "
270- assert np .unique (parents ).size == 1 , err
273+ assert ( np .unique (parents ).size == 1 ) != ( cross_edges . size == 0 ) , err
271274 root = cg .get_root (parents [0 ], time_stamp = parent_ts , raw_only = True )
272275
273276 # inactive edges must be filtered out
You can’t perform that action at this time.
0 commit comments