Skip to content

Commit

Permalink
fix(edits): check for no cx edges; comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akhileshh committed Sep 27, 2023
1 parent 16610c4 commit a8dc5f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pychunkedgraph/graph/edits.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,11 @@ def _process_l2_agglomeration(
cross_edges = agg.cross_edges.get_pairs()
# we must avoid the cache to read roots to get segment state before edit began
parents = cg.get_parents(cross_edges[:, 0], time_stamp=parent_ts, raw_only=True)

# if there are cross edges, there must be a single parent.
# if there aren't any, there must be no parents. XOR these 2 conditions.
err = f"got cross edges from more than one l2 node; op {operation_id}"
assert np.unique(parents).size == 1, err
assert (np.unique(parents).size == 1) != (cross_edges.size == 0), err
root = cg.get_root(parents[0], time_stamp=parent_ts, raw_only=True)

# inactive edges must be filtered out
Expand Down

0 comments on commit a8dc5f6

Please sign in to comment.