def test_get_only_last_results_5(self): results = anomaly_detect_ts(self.data5, max_anoms=0.05, direction='both', only_last=None) last_day = _get_only_last_results(self.a_series, results['anoms'], 'min', 'day') last_hr = _get_only_last_results(self.a_series, results['anoms'], 'min', 'hr') self.assertEquals(6, len(last_day)) self.assertEquals(6, len(last_hr))
def test_get_only_last_results_4_multithreaded(self): results = anomaly_detect_ts(self.data4, max_anoms=0.05, direction='both', only_last=None, multithreaded=True) last_day = _get_only_last_results(self.a_series, results['anoms'], 'min', 'day') last_hr = _get_only_last_results(self.a_series, results['anoms'], 'min', 'hr') self.assertEquals(8, len(last_day)) self.assertEquals(8, len(last_hr))
def test_get_only_last_results(self): results = anomaly_detect_ts(self.data1, max_anoms=0.02, direction='both', only_last=None, plot=False) last_day = _get_only_last_results(self.data1, results['anoms'], 'min', 'day') last_hr = _get_only_last_results(self.data1, results['anoms'], 'min', 'hr') self.assertEquals(23, len(last_day)) self.assertEquals(3, len(last_hr))
def test_get_only_last_results_multithreaded(self): results = anomaly_detect_ts(self.data1, max_anoms=0.02, direction='both', only_last=None, plot=False, multithreaded=True) last_day = _get_only_last_results(self.a_series_multithreaded, results['anoms'], 'min', 'day', multithreaded=True) last_hr = _get_only_last_results(self.a_series_multithreaded, results['anoms'], 'min', 'hr', multithreaded=True) self.assertEquals(23, len(last_day)) self.assertEquals(3, len(last_hr))