From 8294a99889570fdb8b6a1fc493622361e38324da Mon Sep 17 00:00:00 2001 From: Antonio Vilches Date: Thu, 6 Sep 2018 17:47:58 +0200 Subject: [PATCH 1/5] Adding a new test for Array operations --- tests/unit_tests/array_unit_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit_tests/array_unit_tests.py b/tests/unit_tests/array_unit_tests.py index 991ad5a..8b8e85a 100644 --- a/tests/unit_tests/array_unit_tests.py +++ b/tests/unit_tests/array_unit_tests.py @@ -291,6 +291,12 @@ def testIadd(self): a += b np.testing.assert_array_equal(a.to_numpy(), np.array([2, 4, 6, 8])) + def testIaddSelfArray(self): + a = Array([1, 2, 3, 4]) + a += a + np.testing.assert_array_equal(a.to_numpy(), np.array([2, 4, 6, 8])) + + def testISub(self): a = Array([1, 2, 3, 4]) b = Array([1, 2, 3, 4]) From b80243e1003f81810885bce0b1ca97fa9117d5c7 Mon Sep 17 00:00:00 2001 From: David Cuesta Date: Fri, 7 Sep 2018 09:54:02 +0200 Subject: [PATCH 2/5] documentation fixed --- khiva/matrix.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/khiva/matrix.py b/khiva/matrix.py index 1a7e870..f2701f3 100644 --- a/khiva/matrix.py +++ b/khiva/matrix.py @@ -77,6 +77,10 @@ def find_best_n_motifs(profile, index, m, n, self_join=False): def stomp(first_time_series, second_time_series, subsequence_length): """ Stomp algorithm to calculate the matrix profile between `ta` and `tb` using a subsequence length of `m`. + [1] Yan Zhu, Zachary Zimmerman, Nader Shakibay Senobari, Chin-Chia Michael Yeh, Gareth Funning, Abdullah Mueen, + Philip Brisk and Eamonn Keogh (2016). Matrix Profile II: Exploiting a Novel Algorithm and GPUs to break the one + Hundred Million Barrier for Time Series Motifs and Joins. IEEE ICDM 2016. + :param first_time_series: KHIVA array with the first time series. :param second_time_series: KHIVA array with the second time series. :param subsequence_length: Length of the subsequence. @@ -99,6 +103,11 @@ def stomp_self_join(time_series, subsequence_length): """ Stomp algorithm to calculate the matrix profile between `t` and itself using a subsequence length of `m`. This method filters the trivial matches. + + [1] Yan Zhu, Zachary Zimmerman, Nader Shakibay Senobari, Chin-Chia Michael Yeh, Gareth Funning, Abdullah Mueen, + Philip Brisk and Eamonn Keogh (2016). Matrix Profile II: Exploiting a Novel Algorithm and GPUs to break the one + Hundred Million Barrier for Time Series Motifs and Joins. IEEE ICDM 2016. + :param time_series: The query and reference time series in KHIVA array format. :param subsequence_length: Lenght of the subsequence :return: KHIVA arrays with the profile and index. From d69fcd71c8f18230e92ac8f26cdbc157b1bf1c59 Mon Sep 17 00:00:00 2001 From: Antonio Vilches Date: Thu, 6 Sep 2018 17:47:58 +0200 Subject: [PATCH 3/5] Adding a new test for Array operations --- tests/unit_tests/array_unit_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit_tests/array_unit_tests.py b/tests/unit_tests/array_unit_tests.py index 388360e..df19943 100644 --- a/tests/unit_tests/array_unit_tests.py +++ b/tests/unit_tests/array_unit_tests.py @@ -294,6 +294,12 @@ def testIadd(self): a += b np.testing.assert_array_equal(a.to_numpy(), np.array([2, 4, 6, 8])) + def testIaddSelfArray(self): + a = Array([1, 2, 3, 4]) + a += a + np.testing.assert_array_equal(a.to_numpy(), np.array([2, 4, 6, 8])) + + def testISub(self): a = Array([1, 2, 3, 4]) b = Array([1, 2, 3, 4]) From de7476491403177d78ab9f33faf7bbea2a7da946 Mon Sep 17 00:00:00 2001 From: Antonio Vilches Date: Fri, 7 Sep 2018 10:39:21 +0200 Subject: [PATCH 4/5] Deleting empty line. --- tests/unit_tests/array_unit_tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit_tests/array_unit_tests.py b/tests/unit_tests/array_unit_tests.py index df19943..bfdda60 100644 --- a/tests/unit_tests/array_unit_tests.py +++ b/tests/unit_tests/array_unit_tests.py @@ -299,7 +299,6 @@ def testIaddSelfArray(self): a += a np.testing.assert_array_equal(a.to_numpy(), np.array([2, 4, 6, 8])) - def testISub(self): a = Array([1, 2, 3, 4]) b = Array([1, 2, 3, 4]) From d68694b2b9455cb374bb30380195dc7024a163ab Mon Sep 17 00:00:00 2001 From: David Cuesta Date: Fri, 7 Sep 2018 11:04:24 +0200 Subject: [PATCH 5/5] empty line deleted --- khiva/matrix.py | 1 - 1 file changed, 1 deletion(-) diff --git a/khiva/matrix.py b/khiva/matrix.py index f2701f3..7d0c3c7 100644 --- a/khiva/matrix.py +++ b/khiva/matrix.py @@ -103,7 +103,6 @@ def stomp_self_join(time_series, subsequence_length): """ Stomp algorithm to calculate the matrix profile between `t` and itself using a subsequence length of `m`. This method filters the trivial matches. - [1] Yan Zhu, Zachary Zimmerman, Nader Shakibay Senobari, Chin-Chia Michael Yeh, Gareth Funning, Abdullah Mueen, Philip Brisk and Eamonn Keogh (2016). Matrix Profile II: Exploiting a Novel Algorithm and GPUs to break the one Hundred Million Barrier for Time Series Motifs and Joins. IEEE ICDM 2016.