File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ def eval_data(data: "yaml_structure", calibration={}):
8585 import warnings
8686 from yaml import MappingNode , SequenceNode , ScalarNode
8787
88+ import math
89+ d = calibration .copy ()
90+ d ['log' ] = math .log
91+ d ['exp' ] = math .exp
92+
8893 if isinstance (data , ScalarNode ):
8994
9095 val = data .value
@@ -94,7 +99,9 @@ def eval_data(data: "yaml_structure", calibration={}):
9499 elif isinstance (val , str ):
95100 # could be a string, could be an expression, could depend on other sections
96101 try :
97- val = eval (val .replace ("^" , "**" ), calibration )
102+ print (val )
103+ print (d )
104+ val = eval (val .replace ("^" , "**" ), d )
98105 except Exception as e :
99106 warnings .warn (f"Impossible to evaluate expression: { val } " )
100107 return val
You can’t perform that action at this time.
0 commit comments