Skip to content

Commit

Permalink
get rid of prints
Browse files Browse the repository at this point in the history
  • Loading branch information
robbles committed Feb 26, 2012
1 parent fe5021d commit 95830da
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions opendata/recommendation.py
Expand Up @@ -8,14 +8,12 @@ def find_max_and_min_points(list_of_locations):
#sort based on x to find max and min
list_of_locations = sorted(list_of_locations,
cmp=lambda tupleA, tupleB: cmp(tupleA[0], tupleB[0]))
print list_of_locations
max_tuple = list_of_locations[-1]
min_tuple = list_of_locations[0]
max_x = max_tuple[0]
# sort based on y to find max and min
list_of_locations = sorted(list_of_locations,
cmp=lambda tupleA, tupleB: cmp(tupleA[1], tupleB[1]))
print list_of_locations
max_tuple = list_of_locations[-1]
min_tuple = list_of_locations[0]
max_y = max_tuple[1]
Expand All @@ -34,21 +32,14 @@ def find_distance(tuple1, tuple2):
def find_closest_fountain(current_location_tuple, list_of_fountain_tuples):
closest_tuple = list_of_fountain_tuples[0]
current_min_distance = find_distance(current_location_tuple, list_of_fountain_tuples[0])
print 'Looking for closest tuple to (%f,%f)' % current_location_tuple
print 'min distance is %f' % current_min_distance

for fountain_location in list_of_fountain_tuples:
distance = find_distance(current_location_tuple, fountain_location)

print 'Checking tuple (%f,%f)' % fountain_location
print 'new distance is %f' % distance

if distance < current_min_distance:
print 'Tuple (%f,%f) is closer' % fountain_location
current_min_distance = distance
closest_tuple = fountain_location

print '(%f,%f) is the closest!!' % current_location_tuple
return closest_tuple


0 comments on commit 95830da

Please sign in to comment.