Skip to content

Commit

Permalink
Merge pull request #33 from MunchLab/bug/searchsorted
Browse files Browse the repository at this point in the history
Update searchsorted side parameter to 'right' for all arrays
  • Loading branch information
lizliz authored Dec 3, 2024
2 parents f072a6a + 39386a6 commit 66e3098
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ect/ect/ect_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ def calculateECC(self, G, theta, bound_radius=None, return_counts=False):
g_e_list = np.array([g_e[e] for e in e_list])
sorted_g_e_list = np.sort(g_e_list)

vertex_count = np.searchsorted(sorted_g_list, r_threshes, side='left')
edge_count = np.searchsorted(sorted_g_e_list, r_threshes, side='left')
vertex_count = np.searchsorted(sorted_g_list, r_threshes, side='right')
edge_count = np.searchsorted(sorted_g_e_list, r_threshes, side='right')

if isinstance(G, EmbeddedCW):
f_list, g_f = G.sort_faces(theta, return_g=True)
g_f_list = np.array([g_f[f] for f in f_list])
sorted_g_f_list = np.sort(g_f_list)
face_count = np.searchsorted(sorted_g_f_list, r_threshes, side='left')
face_count = np.searchsorted(sorted_g_f_list, r_threshes, side='right')
else:
face_count = np.zeros_like(r_threshes, dtype=np.int32)

Expand Down

0 comments on commit 66e3098

Please sign in to comment.