Skip to content

Commit

Permalink
Add heap type hinting as shown in numba docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Sep 16, 2021
1 parent 46b167a commit 5126cf9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plateseg/watershed.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ def raveled_affinity_watershed(
output : 1D array of int
The output array for markers.
"""
heap = []
n_neighbors = offsets.shape[0]
age = 1
age = 0
marker_coords = marker_coords.astype(np.intp)
offsets = offsets.astype(np.intp)
aff_offsets = offsets.copy().astype(np.intp)
aff_offsets[:int(len(offsets) / 2), 1] = 0
heap = [Element(image_raveled[0], age, marker_coords[0], marker_coords[0])]
_ = heappop(heap)
# add each seed to the stack
for i in range(marker_coords.shape[0]):
index = marker_coords[i]
value = np.float32(0.)
source = index
index = index
age = 0
elem = Element(value, age, index, source)
heappush(heap, elem)
# remove from stack until empty
Expand Down

0 comments on commit 5126cf9

Please sign in to comment.