Skip to content

Commit 862a9a5

Browse files
authored
Merge pull request #9 from EconForge/albop/many_fixes
Albop/many fixes
2 parents 9120ef2 + 0fde125 commit 862a9a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dolang/language.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ def eval_data(data: "yaml_structure", calibration={}):
8585
import warnings
8686
from yaml import MappingNode, SequenceNode, ScalarNode
8787

88+
d = calibration.copy()
89+
d.update(functions)
90+
8891
if isinstance(data, ScalarNode):
8992

9093
val = data.value
@@ -94,7 +97,7 @@ def eval_data(data: "yaml_structure", calibration={}):
9497
elif isinstance(val, str):
9598
# could be a string, could be an expression, could depend on other sections
9699
try:
97-
val = eval(val.replace("^", "**"), calibration)
100+
val = eval(val.replace("^", "**"), d)
98101
except Exception as e:
99102
warnings.warn(f"Impossible to evaluate expression: {val}")
100103
return val

0 commit comments

Comments
 (0)