Skip to content

Commit 1d9659b

Browse files
committed
fix(sv_split): update multicut test
1 parent ec42c91 commit 1d9659b

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

pychunkedgraph/app/segmentation/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ def handle_split(table_id):
472472
)
473473
overlap_mask = np.isin(sources_remapped, sinks_remapped)
474474
for sv_to_split in np.unique(sources_remapped[overlap_mask]):
475-
_mask0 = sources_remapped[sources_remapped == sv_to_split]
476-
_mask1 = sinks_remapped[sinks_remapped == sv_to_split]
475+
_mask0 = sources_remapped == sv_to_split
476+
_mask1 = sinks_remapped == sv_to_split
477477
split_supervoxel(
478478
cg,
479479
sv_to_split,

pychunkedgraph/graph/edits_sv.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ def _get_whole_sv(
5656
mask = _cx_edges[:, 0] == vertex
5757
neighbors = _cx_edges[mask][:, 1]
5858

59-
neighbor_coords = cg.get_chunk_coordinates_multiple(neighbors)
60-
min_mask = (neighbor_coords >= min_coord).all(axis=1)
61-
max_mask = (neighbor_coords < max_coord).all(axis=1)
62-
neighbors = neighbors[min_mask & max_mask]
59+
if len(neighbors) > 0:
60+
neighbor_coords = cg.get_chunk_coordinates_multiple(neighbors)
61+
min_mask = (neighbor_coords >= min_coord).all(axis=1)
62+
max_mask = (neighbor_coords < max_coord).all(axis=1)
63+
neighbors = neighbors[min_mask & max_mask]
6364

6465
for neighbor in neighbors:
6566
if neighbor in explored_nodes:

pychunkedgraph/tests/test_uncategorized.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ def test_path_augmented_multicut(self, sv_data):
18721872
cut_edges_aug = run_multicut(edges, sv_sources, sv_sinks, path_augment=True)
18731873
assert cut_edges_aug.shape[0] == 350
18741874

1875-
with pytest.raises(exceptions.PreconditionError):
1875+
with pytest.raises(exceptions.SupervoxelSplitRequiredError):
18761876
run_multicut(edges, sv_sources, sv_sinks, path_augment=False)
18771877

18781878

0 commit comments

Comments
 (0)