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

Missing complex value support for SciPy special functions in Numba #1295

Open
brandonwillard opened this issue Nov 11, 2022 · 0 comments
Open
Labels
help wanted Extra attention is needed Numba Involves Numba transpilation

Comments

@brandonwillard
Copy link
Member

brandonwillard commented Nov 11, 2022

It looks like Numba's math.erf does not support complex numbers, which means that our transpilations won't either.
For example:

import math
import numba as nb
import scipy


@nb.njit
def math_erf_fn(x):
    return math.erf(x)


math_erf_fn(1.0)
# 0.8427007929497149

math_erf_fn(complex(1.0))
# TypingError: Failed in nopython mode pipeline (step: nopython frontend)
# No implementation of function Function(<built-in function erf>) found for signature:
#
#  >>> erf(complex128)


@nb.njit
def scipy_erf_fn(x):
    return scipy.special.erf(x)


scipy_erf_fn(1.0)
# 0.8427007929497148

scipy_erf_fn(complex(1.0))
# TypingError: Failed in nopython mode pipeline (step: nopython frontend)
# No implementation of function Function(<ufunc 'erf'>) found for signature:
#
#  >>> erf(complex128)

This was observed via tests.tensor.test_math_scipy failures in #1289.

@brandonwillard brandonwillard added the Numba Involves Numba transpilation label Nov 11, 2022
@brandonwillard brandonwillard added the help wanted Extra attention is needed label Nov 11, 2022
@brandonwillard brandonwillard changed the title Missing complex value support for Numba special functions Missing complex value support for SciPy special functions in Numba Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Numba Involves Numba transpilation
Projects
None yet
Development

No branches or pull requests

1 participant