numexpr
numexpr copied to clipboard
Question about usage of the new `_names_cache` in another library
Hello,
In this module of Awkward Array: https://github.com/scikit-hep/awkward/blob/main/src/awkward/_connect/numexpr.py we implement "bindings" of awkward arrays to numexpr so that numexpr can evaluate expressions between awkward arrays.
In the latest numexpr release (2.11), there is an issue with the following lines: https://github.com/scikit-hep/awkward/blob/8e2d4a85420e89617ccf5be0edef841d3b2d57bf/src/awkward/_connect/numexpr.py#L82-L86
The problem is evident because since commit https://github.com/pydata/numexpr/commit/33ee71b0c6f13224f3031cd8b42921c748ce9ede, numexpr.necompiler._names_cache is no longer a CacheDict but a threading.local() and therefore the line expr_key not in numexpr.necompiler._names_cache raises TypeError: argument of type '_thread._local' is not iterable naturally.
I'm opening this issue to ask for any suggestions to minimally overcome this since many things changed internally in the latest numexpr. Is it to just initialize our own CacheDicts inside this module?