@@ -905,7 +905,7 @@ def _permutation_cluster_test(X, threshold, n_permutations, tail, stat_fun,
905
905
partitions = _get_partitions_from_adjacency (adjacency , n_times )
906
906
else :
907
907
partitions = None
908
- logger .info ('Running initial clustering' )
908
+ logger .info ('Running initial clustering … ' )
909
909
out = _find_clusters (t_obs , threshold , tail , adjacency ,
910
910
max_step = max_step , include = include ,
911
911
partitions = partitions , t_power = t_power ,
@@ -919,7 +919,7 @@ def _permutation_cluster_test(X, threshold, n_permutations, tail, stat_fun,
919
919
if isinstance (threshold , dict ):
920
920
t_obs = cluster_stats .reshape (t_obs .shape ) * np .sign (t_obs )
921
921
922
- logger .info ('Found %d clusters' % len (clusters ))
922
+ logger .info (f 'Found { len ( clusters ) } cluster { _pl (clusters )} ' )
923
923
924
924
# convert clusters to old format
925
925
if adjacency is not None and adjacency is not False :
@@ -978,8 +978,11 @@ def _permutation_cluster_test(X, threshold, n_permutations, tail, stat_fun,
978
978
this_include = include
979
979
else :
980
980
this_include = step_down_include
981
- logger .info ('Permuting %d times%s...' % (len (orders ), extra ))
982
- with ProgressBar (len (orders )) as progress_bar :
981
+
982
+ with ProgressBar (
983
+ iterable = range (len (orders )),
984
+ mesg = f'Permuting{ extra } '
985
+ ) as progress_bar :
983
986
H0 = parallel (
984
987
my_do_perm_func (X_full , slices , threshold , tail , adjacency ,
985
988
stat_fun , max_step , this_include , partitions ,
@@ -995,7 +998,7 @@ def _permutation_cluster_test(X, threshold, n_permutations, tail, stat_fun,
995
998
orig = abs (cluster_stats ).max ()
996
999
H0 .insert (0 , [orig ])
997
1000
H0 = np .concatenate (H0 )
998
- logger .info ('Computing cluster p-values' )
1001
+ logger .debug ('Computing cluster p-values' )
999
1002
cluster_pv = _pval_from_histogram (cluster_stats , H0 , tail )
1000
1003
1001
1004
# figure out how many new ones will be removed for step-down
@@ -1014,7 +1017,7 @@ def _permutation_cluster_test(X, threshold, n_permutations, tail, stat_fun,
1014
1017
'cluster%s to exclude from subsequent iterations'
1015
1018
% (n_step_downs , n_removed , a_text ,
1016
1019
_pl (n_removed )))
1017
- logger . info ( 'Done.' )
1020
+
1018
1021
# The clusters should have the same shape as the samples
1019
1022
clusters = _reshape_clusters (clusters , sample_shape )
1020
1023
return t_obs , clusters , cluster_pv , H0
0 commit comments