f8d9a6c144ef84bad2478a4ba4eedb1c559274e0,skimage/_shared/coord.py,,ensure_spacing,#,5
Before Change
tree = cKDTree(coord)
indices = tree.query_ball_point(coord, r=spacing, p=p_norm)
rejected_peaks_indices = set()
for idx, candidates in enumerate(indices):
if idx not in rejected_peaks_indices:
// keep current point and the points at exactly spacing from it
candidates.remove(idx)
dist = distance.cdist([coord[idx]],
coord[candidates],
distance.minkowski,
p=p_norm).reshape(-1)
candidates = [c for c, d in zip(candidates, dist)
if d < spacing]
// candidates.remove(keep)
rejected_peaks_indices.update(candidates)
// Remove the peaks that are too close to each other
output = np.delete(coord, tuple(rejected_peaks_indices), axis=0)
return output
After Change
coords = np.atleast_2d(coords)
if batch_size is None:
batch_list = [coords]
else:
batch_list = np.array_split(coords, batch_size)
output = np.zeros((0, coords.shape[1]))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: scikit-image/scikit-image
Commit Name: f8d9a6c144ef84bad2478a4ba4eedb1c559274e0
Time: 2020-11-11
Author: rfezzani@gmail.com
File Name: skimage/_shared/coord.py
Class Name:
Method Name: ensure_spacing
Project Name: biotite-dev/biotite
Commit Name: 4f3a3ea6c3d02b1bd0f4ec5e688666f125e32be8
Time: 2020-11-27
Author: tom.mueller@beachouse.de
File Name: src/biotite/structure/dotbracket.py
Class Name:
Method Name: base_pairs_from_dot_bracket
Project Name: daniellerch/aletheia
Commit Name: 1d275bddd7349b765db88c76ec7dcfdf85de0f42
Time: 2020-11-07
Author: kevin.clark@gmail.com
File Name: aletheialib/attacks.py
Class Name:
Method Name: difference