From 9dcf8ffbf6da0820ec5d2f93d3d7079abed3f5a7 Mon Sep 17 00:00:00 2001 From: earthgecko Date: Fri, 29 Jul 2016 11:18:50 +0100 Subject: [PATCH] determine_median bug - Fixed a determine_median error, related to an error that crept in testing although it is not currently used, it was included incorrectly as in patterning the value range of the timeseries had has already been panda.Series into an array. Committed to master branch. Modified: skyline/skyline/analyzer/algorithms.py skyline/skyline/analyzer_dev/algorithms_dev.py skyline/skyline/mirage/mirage_algorithms.py --- skyline/analyzer/algorithms.py | 6 +++--- skyline/analyzer_dev/algorithms_dev.py | 6 +++--- skyline/mirage/mirage_algorithms.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/skyline/analyzer/algorithms.py b/skyline/analyzer/algorithms.py index ee3b70a4..9c415273 100644 --- a/skyline/analyzer/algorithms.py +++ b/skyline/analyzer/algorithms.py @@ -412,14 +412,14 @@ def record_algorithm_error(algorithm_name, traceback_format_exc_string): return False -def determine_median(array): +def determine_median(timeseries): """ - Determine the median in an array of values + Determine the median of the values in the timeseries """ # logger.info('Running ' + str(get_function_name())) try: - np_array = np.array(array) + np_array = pandas.Series([x[1] for x in timeseries]) except: return False try: diff --git a/skyline/analyzer_dev/algorithms_dev.py b/skyline/analyzer_dev/algorithms_dev.py index 6a14a74e..ee0e7832 100644 --- a/skyline/analyzer_dev/algorithms_dev.py +++ b/skyline/analyzer_dev/algorithms_dev.py @@ -328,14 +328,14 @@ def ks_test(timeseries): return None -def determine_median(array): +def determine_median(timeseries): """ - Determine the median in an array of values + Determine the median of the values in the timeseries """ # logger.info('Running ' + str(get_function_name())) try: - np_array = np.array(array) + np_array = pandas.Series([x[1] for x in timeseries]) except: return False try: diff --git a/skyline/mirage/mirage_algorithms.py b/skyline/mirage/mirage_algorithms.py index 2d4dd8be..a07a5f59 100644 --- a/skyline/mirage/mirage_algorithms.py +++ b/skyline/mirage/mirage_algorithms.py @@ -389,14 +389,14 @@ def record_algorithm_error(algorithm_name, traceback_format_exc_string): return False -def determine_median(array): +def determine_median(timeseries): """ - Determine the median in an array of values + Determine the median of the values in the timeseries """ # logger.info('Running ' + str(get_function_name())) try: - np_array = np.array(array) + np_array = pandas.Series([x[1] for x in timeseries]) except: return False try: