From 8f454081db618d898ed5daae0356a9e72f0374a2 Mon Sep 17 00:00:00 2001 From: Vishnu Challa Date: Wed, 25 Mar 2026 18:03:38 -0400 Subject: [PATCH 1/3] Fix orig divisive flow Signed-off-by: Vishnu Challa --- otava/main.py | 2 +- otava/series.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/otava/main.py b/otava/main.py index a017123..777c426 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..5852930 100644 --- a/otava/series.py +++ b/otava/series.py @@ -23,6 +23,7 @@ from otava.analysis import ( TTestStats, + TTestSignificanceTester, compute_change_points, compute_change_points_orig, fill_missing, @@ -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, From 76ed75d2fa2ba3639a6d8c01bc30a28f1777ba15 Mon Sep 17 00:00:00 2001 From: Vishnu Challa Date: Wed, 25 Mar 2026 18:03:38 -0400 Subject: [PATCH 2/3] Fix orig divisive flow Signed-off-by: Vishnu Challa --- otava/main.py | 2 +- otava/series.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/otava/main.py b/otava/main.py index a017123..777c426 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, From 46e0ba72a9adfbb8bb45e8fe9b417349844664aa Mon Sep 17 00:00:00 2001 From: Vishnu Challa Date: Wed, 6 May 2026 13:59:18 -0400 Subject: [PATCH 3/3] fix tests Signed-off-by: Vishnu Challa --- otava/series.py | 1 - tests/cli_help_test.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/otava/series.py b/otava/series.py index 06938e8..d8cb3c4 100644 --- a/otava/series.py +++ b/otava/series.py @@ -24,7 +24,6 @@ from otava.analysis import ( TTestSignificanceTester, TTestStats, - TTestSignificanceTester, compute_change_points, compute_change_points_orig, fill_missing, 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: