@@ -220,7 +220,7 @@ def test_critical_values(
220
220
def test_basic (self , samples , control , pvalue , statistic ):
221
221
rng = np .random .default_rng (11681140010308601919115036826969764808 )
222
222
223
- res = stats .dunnett (* samples , control = control , random_state = rng )
223
+ res = stats .dunnett (* samples , control = control , rng = rng )
224
224
225
225
assert isinstance (res , DunnettResult )
226
226
assert_allclose (res .statistic , statistic , rtol = 5e-5 )
@@ -239,6 +239,7 @@ def test_ttest_ind(self, alternative):
239
239
sample = rng .integers (- 100 , 100 , size = (10 ,))
240
240
control = rng .integers (- 100 , 100 , size = (10 ,))
241
241
242
+ # preserve use of old random_state during SPEC 7 transition
242
243
res = stats .dunnett (
243
244
sample , control = control ,
244
245
alternative = alternative , random_state = rng
@@ -270,7 +271,7 @@ def test_alternatives(self, alternative, pvalue):
270
271
271
272
res = stats .dunnett (
272
273
sample_less , sample_greater , control = control ,
273
- alternative = alternative , random_state = rng
274
+ alternative = alternative , rng = rng
274
275
)
275
276
assert_allclose (res .pvalue , pvalue , atol = 1e-7 )
276
277
@@ -301,7 +302,7 @@ def test_against_R_multicomp_glht(self, case, alternative):
301
302
p_ref = case ['pvalues' ][alternative .replace ('-' , '' )]
302
303
303
304
res = stats .dunnett (* samples , control = control , alternative = alternative ,
304
- random_state = rng )
305
+ rng = rng )
305
306
# atol can't be tighter because R reports some pvalues as "< 1e-4"
306
307
assert_allclose (res .pvalue , p_ref , rtol = 5e-3 , atol = 1e-4 )
307
308
@@ -328,7 +329,7 @@ def test_str(self, alternative):
328
329
329
330
res = stats .dunnett (
330
331
* self .samples_3 , control = self .control_3 , alternative = alternative ,
331
- random_state = rng
332
+ rng = rng
332
333
)
333
334
334
335
# check some str output
@@ -350,7 +351,7 @@ def test_warnings(self):
350
351
rng = np .random .default_rng (189117774084579816190295271136455278291 )
351
352
352
353
res = stats .dunnett (
353
- * self .samples_3 , control = self .control_3 , random_state = rng
354
+ * self .samples_3 , control = self .control_3 , rng = rng
354
355
)
355
356
msg = r"Computation of the confidence interval did not converge"
356
357
with pytest .warns (UserWarning , match = msg ):
@@ -396,7 +397,7 @@ def test_shapes(self, n_samples):
396
397
rng = np .random .default_rng (689448934110805334 )
397
398
samples = rng .normal (size = (n_samples , 10 ))
398
399
control = rng .normal (size = 10 )
399
- res = stats .dunnett (* samples , control = control , random_state = rng )
400
+ res = stats .dunnett (* samples , control = control , rng = rng )
400
401
assert res .statistic .shape == (n_samples ,)
401
402
assert res .pvalue .shape == (n_samples ,)
402
403
ci = res .confidence_interval ()
0 commit comments