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


    

    output = coords
    if len(coords):

        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]))
        for batch in batch_list:
            output = _ensure_spacing(np.vstack([output, batch]),
                                     spacing, p_norm)

    return output
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: mlpack/benchmarks
Commit Name: bfbc7582aa9e6a3e1fde6679663232f1f3f1d1fa
Time: 2019-04-24
Author: rukman.sai2@gmail.com
File Name: methods/shogun/lda.py
Class Name: SHOGUN_LDA
Method Name: __init__


Project Name: oddt/oddt
Commit Name: 86698c801848975de9a21fb17093e045b6271ea3
Time: 2018-05-17
Author: maciek@wojcikowski.pl
File Name: rdkit_fixer.py
Class Name:
Method Name: PreparePDBMol