File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,19 @@ def run_instance(interface, options):
33
33
print "setting function inputs"
34
34
for input_name , _ in interface .inputs .items ():
35
35
if getattr (options , input_name ) != None :
36
- str_value = getattr (options , input_name )
37
- casted_value = getattr (interface .inputs , input_name )(str_value )
38
- setattr (interface .inputs , input_name ,
39
- casted_value )
36
+ value = getattr (options , input_name )
37
+ #traits cannot cast from string to float or int
38
+ try :
39
+ value = float (value )
40
+ except :
41
+ pass
42
+
43
+ try :
44
+ setattr (interface .inputs , input_name ,
45
+ value )
46
+ except ValueError , e :
47
+ print "Error when setting the value of %s: '%s'" % (input_name , str (e ))
48
+
40
49
print interface .inputs
41
50
res = interface .run ()
42
51
print res .outputs
You can’t perform that action at this time.
0 commit comments