@@ -54,10 +54,12 @@ def test_break_location_near_truth(
5454
5555 def test_strong_break_rejects (self , rng : np .random .Generator ) -> None :
5656 """A very large mean shift should be detected by all three statistics."""
57- y = np .concatenate ([
58- rng .standard_normal (100 ),
59- rng .standard_normal (100 ) + 10 ,
60- ])
57+ y = np .concatenate (
58+ [
59+ rng .standard_normal (100 ),
60+ rng .standard_normal (100 ) + 10 ,
61+ ]
62+ )
6163
6264 test = AndrewsPlobergerTest (y )
6365 results = test .fit ()
@@ -122,10 +124,12 @@ def test_sup_f_geq_ave_f(
122124
123125 def test_large_for_strong_break (self , rng : np .random .Generator ) -> None :
124126 """Statistics should be large for a strong break."""
125- y = np .concatenate ([
126- rng .standard_normal (100 ),
127- rng .standard_normal (100 ) + 10 ,
128- ])
127+ y = np .concatenate (
128+ [
129+ rng .standard_normal (100 ),
130+ rng .standard_normal (100 ) + 10 ,
131+ ]
132+ )
129133
130134 test = AndrewsPlobergerTest (y )
131135 results = test .fit ()
@@ -243,9 +247,7 @@ def test_critical_values_increasing_with_alpha(
243247 ]:
244248 assert cv_dict [0.10 ] < cv_dict [0.05 ] < cv_dict [0.01 ]
245249
246- def test_critical_values_vary_with_trimming (
247- self , rng : np .random .Generator
248- ) -> None :
250+ def test_critical_values_vary_with_trimming (self , rng : np .random .Generator ) -> None :
249251 """Critical values should differ for different trimming fractions."""
250252 y = rng .standard_normal (200 )
251253
@@ -281,9 +283,9 @@ def test_small_pvalues_for_break(
281283 results = test .fit ()
282284
283285 # At least one p-value should be small
284- assert min (
285- results .sup_f_pvalue , results .exp_f_pvalue , results .ave_f_pvalue
286- ) < 0.10
286+ assert (
287+ min ( results .sup_f_pvalue , results .exp_f_pvalue , results .ave_f_pvalue ) < 0.10
288+ )
287289
288290 def test_large_pvalues_for_no_break (self , rng : np .random .Generator ) -> None :
289291 """P-values should be large when there is no break."""
@@ -297,10 +299,12 @@ def test_large_pvalues_for_no_break(self, rng: np.random.Generator) -> None:
297299
298300 def test_pvalues_consistent_with_cvs (self , rng : np .random .Generator ) -> None :
299301 """P-values should be consistent with critical value comparison."""
300- y = np .concatenate ([
301- rng .standard_normal (100 ),
302- rng .standard_normal (100 ) + 5 ,
303- ])
302+ y = np .concatenate (
303+ [
304+ rng .standard_normal (100 ),
305+ rng .standard_normal (100 ) + 5 ,
306+ ]
307+ )
304308
305309 test = AndrewsPlobergerTest (y )
306310 results = test .fit ()
@@ -336,9 +340,7 @@ def test_various_trimming_values(
336340 assert results .trimming == trimming
337341 assert len (results .f_sequence ) > 0
338342
339- def test_narrower_trimming_more_candidates (
340- self , rng : np .random .Generator
341- ) -> None :
343+ def test_narrower_trimming_more_candidates (self , rng : np .random .Generator ) -> None :
342344 """Narrower trimming should produce more candidate dates."""
343345 y = rng .standard_normal (200 )
344346
@@ -578,10 +580,12 @@ class TestEdgeCases:
578580
579581 def test_small_sample (self , rng : np .random .Generator ) -> None :
580582 """Test with a small sample."""
581- y = np .concatenate ([
582- rng .standard_normal (30 ),
583- rng .standard_normal (30 ) + 5 ,
584- ])
583+ y = np .concatenate (
584+ [
585+ rng .standard_normal (30 ),
586+ rng .standard_normal (30 ) + 5 ,
587+ ]
588+ )
585589
586590 test = AndrewsPlobergerTest (y )
587591 results = test .fit (trimming = 0.15 )
@@ -608,10 +612,12 @@ def test_partial_break(self, rng: np.random.Generator) -> None:
608612
609613 def test_strong_break_all_reject (self , rng : np .random .Generator ) -> None :
610614 """Very strong break should cause all three statistics to reject."""
611- y = np .concatenate ([
612- rng .standard_normal (100 ),
613- rng .standard_normal (100 ) + 10 ,
614- ])
615+ y = np .concatenate (
616+ [
617+ rng .standard_normal (100 ),
618+ rng .standard_normal (100 ) + 10 ,
619+ ]
620+ )
615621
616622 test = AndrewsPlobergerTest (y )
617623 results = test .fit ()
@@ -620,10 +626,12 @@ def test_strong_break_all_reject(self, rng: np.random.Generator) -> None:
620626
621627 def test_constant_only_model (self , rng : np .random .Generator ) -> None :
622628 """Test with default constant-only (mean-shift) model."""
623- y = np .concatenate ([
624- rng .standard_normal (100 ),
625- rng .standard_normal (100 ) + 3 ,
626- ])
629+ y = np .concatenate (
630+ [
631+ rng .standard_normal (100 ),
632+ rng .standard_normal (100 ) + 3 ,
633+ ]
634+ )
627635
628636 test = AndrewsPlobergerTest (y )
629637 results = test .fit ()
@@ -669,10 +677,12 @@ def test_plot_f_sequence_function(self, rng: np.random.Generator) -> None:
669677 """Test the standalone plot_f_sequence function."""
670678 import matplotlib .pyplot as plt
671679
672- y = np .concatenate ([
673- rng .standard_normal (100 ),
674- rng .standard_normal (100 ) + 3 ,
675- ])
680+ y = np .concatenate (
681+ [
682+ rng .standard_normal (100 ),
683+ rng .standard_normal (100 ) + 3 ,
684+ ]
685+ )
676686
677687 test = AndrewsPlobergerTest (y )
678688 results = test .fit ()
0 commit comments