From dbaf31d2d56189fb7e789206d13107ab9c087ab0 Mon Sep 17 00:00:00 2001 From: aciepli Date: Fri, 5 Feb 2016 16:26:00 -0700 Subject: [PATCH 01/11] Create .travis.ym --- .travis.ym | 1 + 1 file changed, 1 insertion(+) create mode 100644 .travis.ym diff --git a/.travis.ym b/.travis.ym new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.travis.ym @@ -0,0 +1 @@ + From b486b5e9987a6a1b50c78fd7c032f0213fdf2bbd Mon Sep 17 00:00:00 2001 From: aciepli Date: Fri, 5 Feb 2016 16:26:35 -0700 Subject: [PATCH 02/11] Delete .travis.ym --- .travis.ym | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .travis.ym diff --git a/.travis.ym b/.travis.ym deleted file mode 100644 index 8b13789..0000000 --- a/.travis.ym +++ /dev/null @@ -1 +0,0 @@ - From 77706ba695561f91b7e8219d2449288d13240b7c Mon Sep 17 00:00:00 2001 From: aciepli Date: Fri, 5 Feb 2016 16:26:51 -0700 Subject: [PATCH 03/11] Create .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ + From 2fc9be7b0a34efe7a110f531e9ff32b006ea88d6 Mon Sep 17 00:00:00 2001 From: aciepli Date: Sun, 7 Feb 2016 16:30:53 -0700 Subject: [PATCH 04/11] Update point_pattern.py --- point_pattern.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/point_pattern.py b/point_pattern.py index 9ae56ee..9016783 100644 --- a/point_pattern.py +++ b/point_pattern.py @@ -1,4 +1,4 @@ -import math # I am guessing that you will need to use the math module +import math """ Below are 5 functions (we will talk about what @@ -27,7 +27,7 @@ def manhattan_distance(a, b): distance : float The Manhattan distance between the two points """ - distance = None # Add the algorithm to compute manhattan distance here + distance = (abs(a[0]-b[0]) + abs(a[1]-b[1])) return distance @@ -49,7 +49,7 @@ def euclidean_distance(a, b): distance : float The Euclidean distance between the two points """ - distance = None # Add the euclidean distance algorithm here + distance = math.sqrt(((a[0] - b[0])**2) + ((a[1] - b[1])**2))) # Add the euclidean distance algorithm here return distance @@ -71,7 +71,7 @@ def shift_point(point, x_shift, y_shift): Returns ------- new_x : int or float - shited x coordinate + shifted x coordinate new_y : int or float shifted y coordinate @@ -87,8 +87,8 @@ def shift_point(point, x_shift, y_shift): x = getx(point) y = gety(point) - x_new = None # Add the logic to shift x here - y_new = None # Add the logic to shift y here + x_new = x + x_shift # Add the logic to shift x here + y_new = y + y_shift # Add the logic to shift y here return x_new, y_new @@ -109,7 +109,13 @@ def check_coincident(a, b): equal : bool Whether the points are equal """ - return None # Add the logic to check if coincident here + if a == b: + coincident_parameters = True + else: + coincident_parameters = False + + return coincident_parameters + def check_in(point, point_list): @@ -124,8 +130,10 @@ def check_in(point, point_list): point_list : list in the form [point, point_1, point_2, ..., point_n] """ - return None # Add the logic to check if a point is in the point list here + return point in point_list + + def getx(point): """ From 3b93f45d4ba356f4ec64ae1f7db99cc4cd3a9746 Mon Sep 17 00:00:00 2001 From: aciepli Date: Sun, 7 Feb 2016 16:32:58 -0700 Subject: [PATCH 05/11] Update .travis.yml --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8b13789..87a047a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,7 @@ +language: python +python: + - "3.5" + +#command to run tests + script: nosetests From 62c5a4b54afc7b462746f4187acc1f3f8f4f3043 Mon Sep 17 00:00:00 2001 From: aciepli Date: Sun, 7 Feb 2016 16:35:38 -0700 Subject: [PATCH 06/11] Update .travis.yml --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87a047a..139597f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,2 @@ -language: python -python: - - "3.5" -#command to run tests - script: nosetests From d573d4fc09f227aa7df8e0962723e74d37a5301b Mon Sep 17 00:00:00 2001 From: aciepli Date: Sun, 7 Feb 2016 17:06:27 -0700 Subject: [PATCH 07/11] Update .travis.yml --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 139597f..d22c0f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,8 @@ +language: python +python: + - "3.5" + +#command to run tests + script: nosetests From 2cd2d267ce6aeedb2bf912d30e514ba9b99f2f65 Mon Sep 17 00:00:00 2001 From: aciepli Date: Sun, 7 Feb 2016 17:22:10 -0700 Subject: [PATCH 08/11] Update .travis.yml --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d22c0f1..b28b04f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,3 @@ -language: python -python: - - "3.5" -#command to run tests - script: nosetests From ce55b5f88bef63d7dd3f08d23dba666c4aba1754 Mon Sep 17 00:00:00 2001 From: aciepli Date: Mon, 8 Feb 2016 15:30:54 -0700 Subject: [PATCH 09/11] Update .travis.yml --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b28b04f..87a047a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ +language: python +python: + - "3.5" - +#command to run tests + script: nosetests From 911dbad507a5f4b4c8250c1f8c1b104787f57801 Mon Sep 17 00:00:00 2001 From: aciepli Date: Mon, 8 Feb 2016 15:47:30 -0700 Subject: [PATCH 10/11] Update point_pattern.py --- point_pattern.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/point_pattern.py b/point_pattern.py index 9016783..1441eb9 100644 --- a/point_pattern.py +++ b/point_pattern.py @@ -27,7 +27,7 @@ def manhattan_distance(a, b): distance : float The Manhattan distance between the two points """ - distance = (abs(a[0]-b[0]) + abs(a[1]-b[1])) + distance = (abs(b[0]-a[0]) + abs(b[1]-a[1])) return distance From 20b028576643d9b7f25f973a384cdc31c7f973d8 Mon Sep 17 00:00:00 2001 From: aciepli Date: Tue, 9 Feb 2016 17:57:23 -0700 Subject: [PATCH 11/11] Update point_pattern.py --- point_pattern.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/point_pattern.py b/point_pattern.py index 1441eb9..d7dca57 100644 --- a/point_pattern.py +++ b/point_pattern.py @@ -49,7 +49,7 @@ def euclidean_distance(a, b): distance : float The Euclidean distance between the two points """ - distance = math.sqrt(((a[0] - b[0])**2) + ((a[1] - b[1])**2))) # Add the euclidean distance algorithm here + distance = math.sqrt((a[0] - b[0])**2) + ((a[1] - b[1])**2)) # Add the euclidean distance algorithm here return distance @@ -111,9 +111,7 @@ def check_coincident(a, b): """ if a == b: coincident_parameters = True - else: - coincident_parameters = False - + return coincident_parameters