Skip to content

Question about usage of the new _names_cache in another library #514

Open
@ikrommyd

Description

@ikrommyd

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 33ee71b, 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions