@@ -264,9 +264,10 @@ def plot_model_comparison(result, sort=False, colors=None,
264
264
models = [models [i ] for i in idx ]
265
265
if not ('descend' in sort .lower () or
266
266
'ascend' in sort .lower ()):
267
- raise Exception ('plot_model_comparison: Argument ' +
268
- 'sort is incorrectly defined as '
269
- + sort + '.' )
267
+ raise ValueError (
268
+ 'plot_model_comparison: Argument ' +
269
+ 'sort is incorrectly defined as ' +
270
+ sort + '.' )
270
271
271
272
# run tests
272
273
if any ([test_pair_comparisons ,
@@ -290,9 +291,10 @@ def plot_model_comparison(result, sort=False, colors=None,
290
291
elif 'nili' in test_pair_comparisons .lower ():
291
292
h_pair_tests = 0.4
292
293
else :
293
- raise Exception ('plot_model_comparison: Argument ' +
294
- 'test_pair_comparisons is incorrectly defined as '
295
- + test_pair_comparisons + '.' )
294
+ raise ValueError (
295
+ 'plot_model_comparison: Argument ' +
296
+ 'test_pair_comparisons is incorrectly defined as ' +
297
+ test_pair_comparisons + '.' )
296
298
ax = plt .axes ((l , b , w , h * (1 - h_pair_tests )))
297
299
axbar = plt .axes ((l , b + h * (1 - h_pair_tests ), w ,
298
300
h * h_pair_tests * 0.7 ))
@@ -359,7 +361,7 @@ def plot_model_comparison(result, sort=False, colors=None,
359
361
marker = 10 , markersize = half_sym_size ,
360
362
linewidth = 0 )
361
363
else :
362
- raise Exception (
364
+ raise ValueError (
363
365
'plot_model_comparison: Argument test_above_0' +
364
366
' is incorrectly defined as ' + test_above_0 + '.' )
365
367
@@ -396,7 +398,7 @@ def plot_model_comparison(result, sort=False, colors=None,
396
398
markerfacecolor = noise_ceil_col ,
397
399
markeredgecolor = 'none' , linewidth = 0 )
398
400
else :
399
- raise Exception (
401
+ raise ValueError (
400
402
'plot_model_comparison: Argument ' +
401
403
'test_below_noise_ceil is incorrectly defined as ' +
402
404
test_below_noise_ceil + '.' )
@@ -908,7 +910,7 @@ def _get_model_comp_descr(test_type, n_models, multiple_pair_testing, alpha,
908
910
' model-pair comparisons)' )
909
911
else :
910
912
if 'uncorrected' not in multiple_pair_testing .lower ():
911
- raise Exception (
913
+ raise ValueError (
912
914
'plot_model_comparison: Argument ' +
913
915
'multiple_pair_testing is incorrectly defined as ' +
914
916
multiple_pair_testing + '.' )
0 commit comments