@@ -71,7 +71,7 @@ cpdef np.ndarray condense_tree(np.ndarray[np.double_t, ndim=2] hierarchy,
7171 cdef list result_list
7272
7373 cdef np.ndarray[np.intp_t, ndim= 1 ] relabel
74- cdef np.ndarray[np.int_t , ndim= 1 ] ignore
74+ cdef np.ndarray[np.int8_t , ndim= 1 ] ignore
7575 cdef np.ndarray[np.double_t, ndim= 1 ] children
7676
7777 cdef np.intp_t node
@@ -91,7 +91,7 @@ cpdef np.ndarray condense_tree(np.ndarray[np.double_t, ndim=2] hierarchy,
9191 relabel = np.empty(root + 1 , dtype = np.intp)
9292 relabel[root] = num_points
9393 result_list = []
94- ignore = np.zeros(len (node_list), dtype = int )
94+ ignore = np.zeros(len (node_list), dtype = np.int8 )
9595
9696 for node in node_list:
9797 if ignore[node] or node < num_points:
@@ -251,7 +251,7 @@ cdef list bfs_from_cluster_tree(np.ndarray tree, np.intp_t bfs_root):
251251
252252 while to_process.shape[0 ] > 0 :
253253 result.extend(to_process.tolist())
254- to_process = tree[' child' ][np.in1d (tree[' parent' ], to_process)]
254+ to_process = tree[' child' ][np.isin (tree[' parent' ], to_process)]
255255
256256 return result
257257
@@ -725,8 +725,10 @@ cpdef tuple get_clusters(np.ndarray tree, dict stability,
725725 # if you do, change this accordingly!
726726 if allow_single_cluster:
727727 node_list = sorted (stability.keys(), reverse = True )
728+ node_list = [int (n) for n in node_list]
728729 else :
729730 node_list = sorted (stability.keys(), reverse = True )[:- 1 ]
731+ node_list = [int (n) for n in node_list]
730732 # (exclude root)
731733
732734 cluster_tree = tree[tree[' child_size' ] > 1 ]
0 commit comments