File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -605,13 +605,12 @@ def convert_string_keys_to_variables(input_to_values):
605
605
if not matching_vars :
606
606
raise Exception (f"{ key } not found in graph" )
607
607
elif len (matching_vars ) > 1 :
608
- raise Exception (
609
- f"Found multiple variables with name { key } "
610
- )
608
+ raise Exception (f"Found multiple variables with name { key } " )
611
609
new_input_to_values [matching_vars [0 ]] = value
612
610
else :
613
611
new_input_to_values [key ] = value
614
612
return new_input_to_values
613
+
615
614
inputs_to_values = convert_string_keys_to_variables (inputs_to_values )
616
615
617
616
if not hasattr (self , "_fn_cache" ):
Original file line number Diff line number Diff line change @@ -306,14 +306,14 @@ def test_eval_with_strings(self):
306
306
assert self .w .eval ({"x" : 1.0 , self .y : 2.0 }) == 6.0
307
307
assert self .w .eval ({self .z : 3 }) == 6.0
308
308
309
- def test_eval_errors_having_mulitple_variables_same_name (self ):
309
+ def test_eval_with_strings_multiple_matches (self ):
310
310
e = scalars ("e" )
311
311
t = e + 1
312
312
t .name = "e"
313
313
with pytest .raises (Exception , match = "Found multiple variables with name e" ):
314
314
t .eval ({"e" : 1 })
315
315
316
- def test_eval_errors_with_no_name_exists (self ):
316
+ def test_eval_with_strings_no_match (self ):
317
317
e = scalars ("e" )
318
318
t = e + 1
319
319
t .name = "p"
You can’t perform that action at this time.
0 commit comments