42be11c7824427fb0a8490f3bcd635410ded57b3,trackpy/linking/find_link.py,FindLinker,get_relocate_candidates,#FindLinker#Any#,363

Before Change


        kdtree = cKDTree(coords / max_dist, 30)
        found = kdtree.query_ball_point((pos - origin) / max_dist, 1.)
        if len(found) > 0:
            coords = coords[list(set([i for sl in found for i in sl]))]
        else:
            return None, None

        // drop dimmer points that are closer than separation to each other

After Change



        // drop points that are further than search range from all initial points
        // borrow the rescaling function from the hash
        coords_rescaled = self.hash.to_eucl(origin + coords)
        pos_rescaled = self.hash.to_eucl(pos)
        coords_ok = []
        for coord, coord_rescaled in zip(coords, coords_rescaled):
            dists = np.sqrt(np.sum((coord_rescaled - pos_rescaled)**2, axis=1))
            if np.any(dists <= self.search_range):
                coords_ok.append(coord)
        if len(coords_ok) == 0:
            return None, None
        coords = np.array(coords_ok)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: soft-matter/trackpy
Commit Name: 42be11c7824427fb0a8490f3bcd635410ded57b3
Time: 2017-07-27
Author: caspervdw@gmail.com
File Name: trackpy/linking/find_link.py
Class Name: FindLinker
Method Name: get_relocate_candidates


Project Name: keras-team/keras
Commit Name: 555ca942df407b8c1bf1d48383c60fa1bf09cc1d
Time: 2019-08-28
Author: francois.chollet@gmail.com
File Name: keras/engine/network.py
Class Name: Network
Method Name: losses


Project Name: CellProfiler/CellProfiler
Commit Name: 53059cec9053a8429b7f0a8f06e6cbe1672b60e7
Time: 2013-01-16
Author: leek@broadinstitute.org
File Name: cellprofiler/modules/groups.py
Class Name: Groups
Method Name: on_activated