Skip to content

Commit 3f6f2e2

Browse files
dodamihakhileshh
authored andcommitted
fix: filter children array during meshing
1 parent eba1c4f commit 3f6f2e2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pychunkedgraph/meshing/meshgen_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ def recursive_helper(cur_node_ids):
129129
only_child_mask = np.array(
130130
[len(children_for_node) == 1 for children_for_node in children_array]
131131
)
132-
only_children = children_array[only_child_mask].astype(np.uint64).ravel()
132+
# Extract children from object array - each filtered element is a 1-element array
133+
filtered_children = children_array[only_child_mask]
134+
only_children = (
135+
np.concatenate(filtered_children).astype(np.uint64)
136+
if filtered_children.size
137+
else np.array([], dtype=np.uint64)
138+
)
133139
if np.any(only_child_mask):
134140
temp_array = cur_node_ids[stop_layer_mask]
135141
temp_array[only_child_mask] = recursive_helper(only_children)

0 commit comments

Comments
 (0)