pydata/numexpr

``global_dict`` input ignored in version 2.8.7

euklid321 opened this issue · 5 comments

With numexpr=2.8.7, the global dict input of numexpr.evaluate seems to be ignored:

import numexpr as ne

a = 1
b = 1

print(ne.evaluate("a + b + c", global_dict={"c": 1}))

# Result with numexpr=2.8.4
# 3

# Results with numexpr=2.8.7
# KeyError: 'c'

This is caused by adding validate function and changing the logic of evaluate function.

evaluate function will firstly call validate and if nothing wrong then call re_evaluate. But re_evaluate previously doesn't take global_dict as an argument, which causes the bug.

should be closed by #457