diff globalneighbors/distance.py @ 6:316e1d54ffd4

move to jinja templates
author Jeff Hammel <k0scist@gmail.com>
date Sat, 24 Jun 2017 15:47:59 -0700
parents 7e27e874655b
children 254195d0bac2
line wrap: on
line diff
--- a/globalneighbors/distance.py	Sat Jun 24 15:16:10 2017 -0700
+++ b/globalneighbors/distance.py	Sat Jun 24 15:47:59 2017 -0700
@@ -48,6 +48,15 @@
     else:
         distances.append((i, new_distance))
 
+# def insert_distance(distances, i, new_distance, k):
+#     if not distances:
+#          distances.append((i, new_distance))
+#          return
+#     if new_distance >= distances[-1][-1]:
+#            if len(distances) < k:
+#                distances.append((i, new_distance))
+#            return
+
 
 def calculate_distances(locations, r=Rearth):
     """