carsonfarmer / fastpair

FastPair: Data-structure for the dynamic closest-pair problem.
MIT License
12 stars 4 forks source link

min_points error #15

Closed Rakesh4G closed 3 years ago

Rakesh4G commented 4 years ago

This error/bug happens when there's less pairs than the min_points parameters and we have custom dist function.

(cp_diff, cp_pair) = fp.closest_pair()
      File "/nix/store/65djwzlc0r0w59i5snby2dmfkbpjqm1h-python3.6-fastpair-2016-07-05/lib/python3.6/site-packages/fastpair/base.py", line 178, in closest_pair
        return self.closest_pair_brute_force()
      File "/nix/store/65djwzlc0r0w59i5snby2dmfkbpjqm1h-python3.6-fastpair-2016-07-05/lib/python3.6/site-packages/fastpair/base.py", line 190, in closest_pair_brute_force
        return _closest_pair_brute_force(self.points)
      File "/nix/store/65djwzlc0r0w59i5snby2dmfkbpjqm1h-python3.6-fastpair-2016-07-05/lib/python3.6/site-packages/fastpair/base.py", line 282, in _closest_pair_brute_force
        return min((dst(p1, p2), (p1, p2)) for p1, p2 in combinations(pts, r=2))
      File "/nix/store/65djwzlc0r0w59i5snby2dmfkbpjqm1h-python3.6-fastpair-2016-07-05/lib/python3.6/site-packages/fastpair/base.py", line 282, in <genexpr>
        return min((dst(p1, p2), (p1, p2)) for p1, p2 in combinations(pts, r=2))
      File "/nix/store/qw3cm7qzzvi68cl9ffz06l2xia52v07s-python3.6-scipy-1.0.0/lib/python3.6/site-packages/scipy/spatial/distance.py", line 553, in euclidean
        return minkowski(u, v, p=2, w=w)
      File "/nix/store/qw3cm7qzzvi68cl9ffz06l2xia52v07s-python3.6-scipy-1.0.0/lib/python3.6/site-packages/scipy/spatial/distance.py", line 470, in minkowski
        u_v = u - v
    TypeError: ufunc 'subtract' did not contain a loop with signature matching types dtype('S648') dtype('S648') dtype('S648')
Rakesh4G commented 4 years ago

Starting on this issue now. @vriez @CMCDragonkai