Mercurial > hg > GlobalNeighbors
diff globalneighbors/distance.py @ 3:49aae0c0293b
improved test coverage
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sat, 24 Jun 2017 14:48:31 -0700 |
parents | 1b94f3bf97e5 |
children | 7e27e874655b |
line wrap: on
line diff
--- a/globalneighbors/distance.py Sat Jun 24 14:04:00 2017 -0700 +++ b/globalneighbors/distance.py Sat Jun 24 14:48:31 2017 -0700 @@ -57,19 +57,21 @@ k=10, lat_tol=1., lon_tol=1., - output=1000, + output=None, neighbors=None): """ calculate `k` nearest neighbors for each location + + locations -- dict of `geoid: (lat, lon)` """ neighbors = neighbors or {} - items = locations.items() + items = locations.items() # copy index = 0 n_items = len(items) start = int(time.time()) while items: index += 1 - if not index % output: + if output and not index % output: # output status counter now = int(time.time()) duration = now - start