@@ -29,8 +29,13 @@ def validate_positive(ctx, param, value):
29
29
30
30
31
31
def validate_seed (ctx , param , value ):
32
- if value is not None and (value < 0 or value > (2 ** 32 - 1 )):
33
- raise click .BadParameter ('must be between 0 and 2**32 - 1.' )
32
+ if value is not None :
33
+ try :
34
+ value = int (value )
35
+ except ValueError as e :
36
+ raise click .BadParameter ('must be an integer: {}.' .format (e ))
37
+ if (value < 0 or value > (2 ** 32 - 1 )):
38
+ raise click .BadParameter ('must be between 0 and 2**32 - 1.' )
34
39
return value
35
40
36
41
@@ -281,7 +286,7 @@ def beads_evt_cmd(cruise, cytograms, event_limit, frac, iqr, min_date,
281
286
help = 'Apply noise filter before subsampling.' )
282
287
@click .option ('-p' , '--process-count' , type = int , default = 1 , show_default = True , callback = validate_positive ,
283
288
help = 'Number of processes to use.' )
284
- @click .option ('-s' , '--seed' , type = int , callback = validate_seed ,
289
+ @click .option ('-s' , '--seed' , callback = validate_seed ,
285
290
help = 'Integer seed for PRNG, otherwise system-dependent source of randomness is used to seed the PRNG.' )
286
291
@click .option ('-S' , '--sfl' , 'sfl_path' , type = click .Path (),
287
292
help = """SFL file that can be used to associate dates with EVT files. Useful when
0 commit comments