@@ -24,7 +24,7 @@ class TestOnlineDetectionStepResult:
2424
2525 def test_default_values (self ) -> None :
2626 """Test default values for all fields."""
27- result = OnlineDetectionStepResult ()
27+ result = OnlineDetectionStepResult [ OnlineAlgorithmState ] ()
2828
2929 assert result .step_num == 0
3030 assert result .is_change_point is False
@@ -60,7 +60,7 @@ class TestOnlineDetectionTrace:
6060 """Test suite for OnlineDetectionTrace."""
6161
6262 @pytest .fixture
63- def sample_steps (self ) -> list [OnlineDetectionStepResult ]:
63+ def sample_steps (self ) -> list [OnlineDetectionStepResult [ MockAlgorithmState ] ]:
6464 """Create sample step results for testing."""
6565 state1 = MockAlgorithmState ()
6666 state2 = MockAlgorithmState ()
@@ -104,7 +104,9 @@ def sample_steps(self) -> list[OnlineDetectionStepResult]:
104104 ),
105105 ]
106106
107- def test_from_online_detection_steps (self , sample_steps : list [OnlineDetectionStepResult ]) -> None :
107+ def test_from_online_detection_steps (
108+ self , sample_steps : list [OnlineDetectionStepResult [MockAlgorithmState ]]
109+ ) -> None :
108110 """Test constructing OnlineDetectionTrace from step results."""
109111 trace = OnlineDetectionTrace .from_online_detection_steps (threshold = 0.5 , steps = sample_steps )
110112
@@ -126,7 +128,7 @@ def test_from_online_detection_steps(self, sample_steps: list[OnlineDetectionSte
126128 assert trace .algorithm_states [3 ] is None
127129
128130 def test_from_online_detection_steps_with_none_threshold (
129- self , sample_steps : list [OnlineDetectionStepResult ]
131+ self , sample_steps : list [OnlineDetectionStepResult [ MockAlgorithmState ] ]
130132 ) -> None :
131133 """Test constructing trace with None threshold."""
132134 trace = OnlineDetectionTrace .from_online_detection_steps (threshold = None , steps = sample_steps )
@@ -136,7 +138,7 @@ def test_from_online_detection_steps_with_none_threshold(
136138
137139 def test_from_online_detection_steps_empty (self ) -> None :
138140 """Test constructing trace from empty step sequence."""
139- trace = OnlineDetectionTrace .from_online_detection_steps (threshold = 0.5 , steps = [])
141+ trace = OnlineDetectionTrace [ MockAlgorithmState ] .from_online_detection_steps (threshold = 0.5 , steps = [])
140142
141143 assert trace .threshold == 0.5
142144 assert isinstance (trace .observation_scores , np .ndarray )
@@ -150,7 +152,7 @@ def test_from_online_detection_steps_empty(self) -> None:
150152
151153 def test_from_online_detection_steps_no_detections (self ) -> None :
152154 """Test constructing trace with no changepoints."""
153- steps : list [OnlineDetectionStepResult ] = [
155+ steps : list [OnlineDetectionStepResult [ MockAlgorithmState ] ] = [
154156 OnlineDetectionStepResult (
155157 step_num = i ,
156158 is_change_point = False ,
@@ -208,7 +210,7 @@ def test_inherits_from_detection_trace(self) -> None:
208210 UnivariateNumericArray , np .array ([0.001 , 0.002 , 0.003 ], dtype = np .float64 )
209211 )
210212
211- trace = OnlineDetectionTrace (
213+ trace = OnlineDetectionTrace [ MockAlgorithmState ] (
212214 threshold = 0.5 ,
213215 observation_scores = observation_scores ,
214216 processing_time = processing_times ,
@@ -222,7 +224,7 @@ def test_inherits_from_detection_trace(self) -> None:
222224
223225 def test_multiple_detection_types (self ) -> None :
224226 """Test trace with multiple detection types overlapping."""
225- steps : list [OnlineDetectionStepResult ] = [
227+ steps : list [OnlineDetectionStepResult [ MockAlgorithmState ] ] = [
226228 OnlineDetectionStepResult (
227229 step_num = i ,
228230 is_change_point = (i == 2 ),
@@ -244,7 +246,7 @@ def test_multiple_detection_types(self) -> None:
244246
245247 def test_ndarray_dtype_preservation (self ) -> None :
246248 """Test that NumPy arrays preserve float64 dtype."""
247- steps : list [OnlineDetectionStepResult ] = [
249+ steps : list [OnlineDetectionStepResult [ MockAlgorithmState ] ] = [
248250 OnlineDetectionStepResult (
249251 step_num = i ,
250252 is_change_point = False ,
@@ -271,15 +273,15 @@ def test_skipped_observation_default_mutable(self) -> None:
271273 UnivariateNumericArray , np .array ([0.001 , 0.002 ], dtype = np .float64 )
272274 )
273275
274- trace1 = OnlineDetectionTrace (
276+ trace1 = OnlineDetectionTrace [ MockAlgorithmState ] (
275277 threshold = 0.5 ,
276278 observation_scores = observation_scores ,
277279 processing_time = processing_times ,
278280 algorithm_states = [],
279281 detected_changes = [1 ],
280282 )
281283
282- trace2 = OnlineDetectionTrace (
284+ trace2 = OnlineDetectionTrace [ MockAlgorithmState ] (
283285 threshold = 0.5 ,
284286 observation_scores = observation_scores ,
285287 processing_time = processing_times ,
@@ -302,15 +304,15 @@ def test_forced_change_points_default_mutable(self) -> None:
302304 UnivariateNumericArray , np .array ([0.001 , 0.002 ], dtype = np .float64 )
303305 )
304306
305- trace1 = OnlineDetectionTrace (
307+ trace1 = OnlineDetectionTrace [ MockAlgorithmState ] (
306308 threshold = 0.5 ,
307309 observation_scores = observation_scores ,
308310 processing_time = processing_times ,
309311 algorithm_states = [],
310312 detected_changes = [1 ],
311313 )
312314
313- trace2 = OnlineDetectionTrace (
315+ trace2 = OnlineDetectionTrace [ MockAlgorithmState ] (
314316 threshold = 0.5 ,
315317 observation_scores = observation_scores ,
316318 processing_time = processing_times ,
0 commit comments