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

numpy.array() not handling an array type #2806

Open
zplizzi opened this issue Mar 9, 2018 · 0 comments
Open

numpy.array() not handling an array type #2806

zplizzi opened this issue Mar 9, 2018 · 0 comments
Labels
bug - incorrect behavior Bugs: incorrect behavior

Comments

@zplizzi
Copy link

zplizzi commented Mar 9, 2018

I'm trying to make a jitclass that can take either a list or an array as an argument, to then convert to an array with numpy.array(). However, it seems like the numpy.array() method doesn't handle array types properly. Here's a minimal (failing) example of this problem.

@numba.jit((numba.float64[:],), nopython = True)
def test(v):
    a = np.array(v)
    return a 

Here's what seems to be the relevant parts of the error message (I can post more if helpful), which occurs on simply defining the function above:

TypingError: Invalid usage of Function(<built-in function array>) with parameters (array(float64, 1d, A))
 * parameterized
In definition 0:
    TypingError: array(float64, 1d, A) not allowed in a homogenous sequence
[1] During: resolving callee type: Function(<built-in function array>)
[2] During: typing of call at <ipython-input-163-4b2e73a0638f> (3)

Failed at nopython (nopython frontend)
Invalid usage of Function(<built-in function array>) with parameters (array(float64, 1d, A))
 * parameterized
In definition 0:
    TypingError: array(float64, 1d, A) not allowed in a homogenous sequence
[1] During: resolving callee type: Function(<built-in function array>)
[2] During: typing of call at <ipython-input-163-4b2e73a0638f> (3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - incorrect behavior Bugs: incorrect behavior
Projects
None yet
Development

No branches or pull requests

3 participants