Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More information on numexpr failure #107

Open
kreczko opened this issue Nov 8, 2019 · 0 comments
Open

More information on numexpr failure #107

kreczko opened this issue Nov 8, 2019 · 0 comments

Comments

@kreczko
Copy link
Contributor

kreczko commented Nov 8, 2019

Currently, if something goes wrong while evaluating a numexpr expression, the error message is not very helpful:

  File "/mnt/c/Workspace/fast-carpenter/fast_carpenter/expressions.py", line 115, in evaluate
    result = numexpr.evaluate(cleaned_expression, local_dict=adaptor)
  File "/software/miniconda/envs/hep_py/lib/python3.7/site-packages/numexpr/necompiler.py", line 822, in evaluate
    zip(names, arguments)]
  File "/software/miniconda/envs/hep_py/lib/python3.7/site-packages/numexpr/necompiler.py", line 821, in <listcomp>
    signature = [(name, getType(arg)) for (name, arg) in
  File "/software/miniconda/envs/hep_py/lib/python3.7/site-packages/numexpr/necompiler.py", line 703, in getType
    raise ValueError("unknown type %s" % a.dtype.name)
ValueError: unknown type object

Instead, it would be useful to catch the exception in

result = numexpr.evaluate(cleaned_expression, local_dict=adaptor)

prepend the cleaned_expression to the exception message and re-raise the exception.

E.g.

Error in <stage>.variables."<name>": Unable to evaluate "<expression>".
<numexpr error message>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant