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
NameError in stencil when cval is np.nan or np.inf #7286
Comments
@fbunt Thanks for the report, I can reproduce this on mainline. The issue appears to be in the rendering of the constant |
As title. Fixes numba#7286
As title. Fixes numba#7286
As title. Fixes numba#7286
Fixed in #7288 |
I think you might have to check for |
Good point, I guess this can just specialise for inf and nan. I think that's it for string-like numerical constants from NumPy, are you aware of any others? |
I think those are it. Thanks for looking into this! |
Thanks, and no problem. 619b278 should fix up the case of negative str based const. |
I was playing around with the stencil decorator and tried supplying
np.nan
to thecval
argument. This results in a NameError. It looks like the type inference is not able to infer a type for np.nan. The docs state that any value can be supplied tocval
so I assume this is a bug. The same thing happens fornp.inf
. The below code triggers the error on my machine with version 0.53.1. If this is intended, perhaps the documentation could be updated to indicate that NaNs and infs are not valid.Here is the stack trace:
The text was updated successfully, but these errors were encountered: