Skip to content

Commit 0796394

Browse files
committed
Enable all functions in eval_data.
1 parent 87dd8a1 commit 0796394

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

dolang/language.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,9 @@ def eval_data(data: "yaml_structure", calibration={}):
8484

8585
import warnings
8686
from yaml import MappingNode, SequenceNode, ScalarNode
87-
88-
import math
87+
8988
d = calibration.copy()
90-
d['log'] = math.log
91-
d['exp'] = math.exp
89+
d.update(functions)
9290

9391
if isinstance(data, ScalarNode):
9492

@@ -99,8 +97,6 @@ def eval_data(data: "yaml_structure", calibration={}):
9997
elif isinstance(val, str):
10098
# could be a string, could be an expression, could depend on other sections
10199
try:
102-
print(val)
103-
print(d)
104100
val = eval(val.replace("^", "**"), d)
105101
except Exception as e:
106102
warnings.warn(f"Impossible to evaluate expression: {val}")

0 commit comments

Comments
 (0)