diff --git a/otava/main.py b/otava/main.py index 8748ae2..36671b6 100644 --- a/otava/main.py +++ b/otava/main.py @@ -427,7 +427,7 @@ def setup_analysis_options_parser(parser: argparse.ArgumentParser): ) parser.add_argument( "--orig-edivisive", - type=bool, + action="store_true", default=False, dest="orig_edivisive", help="use the original edivisive algorithm with no windowing " diff --git a/otava/series.py b/otava/series.py index bb3bf47..d8cb3c4 100644 --- a/otava/series.py +++ b/otava/series.py @@ -22,6 +22,7 @@ from typing import Any, Dict, Iterable, List, Optional from otava.analysis import ( + TTestSignificanceTester, TTestStats, compute_change_points, compute_change_points_orig, @@ -248,7 +249,16 @@ def __compute_change_points( values, max_pvalue=options.max_pvalue, ) - result[metric] = change_points + tester = TTestSignificanceTester(options.max_pvalue) + intervals = tester.get_intervals(change_points) + for c in change_points: + cp_ttest = tester.change_point(c.to_candidate(), values, intervals) + result[metric].append( + ChangePoint( + index=cp_ttest.index, qhat=cp_ttest.qhat, + time=series.time[cp_ttest.index], metric=metric, stats=cp_ttest.stats + ) + ) else: change_points, weak_cps = compute_change_points( values, diff --git a/tests/cli_help_test.py b/tests/cli_help_test.py index a0dfa42..2397b55 100644 --- a/tests/cli_help_test.py +++ b/tests/cli_help_test.py @@ -162,7 +162,7 @@ def test_otava_analyze_help_output(): [--output {{log,json,regressions_only}}] [--branch [STRING]] [--metrics LIST] {usage_filter_lines} [--last COUNT] [-P, --p-value PVALUE] [-M MAGNITUDE] [--window WINDOW] - [--orig-edivisive ORIG_EDIVISIVE] + [--orig-edivisive] tests [tests ...] positional arguments: @@ -215,8 +215,7 @@ def test_otava_analyze_help_output(): windows are less susceptible to noise; however, a very large window may cause dismissing short regressions as noise so it is best to keep it short enough to include not more than a few change points (optimally at most 1) - --orig-edivisive ORIG_EDIVISIVE - use the original edivisive algorithm with no windowing and weak change + --orig-edivisive use the original edivisive algorithm with no windowing and weak change points analysis improvements Graphite Options: