pyccel
pyccel copied to clipboard
np.array in c does not handle lists of vector variables
Describe the bug
np.array works for lists of scalars and lists of lists of scalars, but it does not handle lists of variables
To Reproduce Provide code to reproduce the behavior:
@types('real[:,:]','real[:,:]')
def array_real_3d_C_array_initialization_1(x, y):
from numpy import array
tmp = array([x, y], dtype='float')
Provide the generated code, or the error message:
Traceback (most recent call last):
File "/home/emily/Code/pyccel/pyccel/codegen/printing/ccode.py", line 1297, in _print_Assign
return self.copy_NumpyArray_Data(expr)
File "/home/emily/Code/pyccel/pyccel/codegen/printing/ccode.py", line 317, in copy_NumpyArray_Data
arg = functools.reduce(operator.concat, arg)
TypeError: 'Variable' object can't be concatenated
Expected behavior This should be handled, if it is non-trivial then as a first step a neat error should be raised
Language C
it will need a concatenation function to do so.
Error is now:
